Compare commits
2 Commits
0344d646f8
...
1ce60da9cf
Author | SHA1 | Date |
---|---|---|
Sean Dockray | 1ce60da9cf | |
Sean Dockray | f959140f2a |
|
@ -53,6 +53,7 @@ vars = {
|
|||
'tmp_dir': '/tmp',
|
||||
'force': False,
|
||||
'branch': None,
|
||||
'preview_branch': None,
|
||||
}
|
||||
|
||||
# logging time
|
||||
|
@ -156,19 +157,19 @@ published = False
|
|||
refs = cmd([GIT_PATH, 'diff-tree', '--no-commit-id', '--name-only', REF], cwd=GIT_REPO).split("\n")
|
||||
for r in refs:
|
||||
if FORCE or r == "PUBLISH.trigger.md":
|
||||
build_site(WEBSITE, TMP_WEBSITE)
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Check if there is a !publish!
|
||||
if not published:
|
||||
refs = cmd([GIT_PATH, 'show', '--format="%s"', '-s'], cwd=GIT_REPO).split(' ')
|
||||
for r in refs:
|
||||
if r == "!publish!":
|
||||
build_site(WEBSITE, TMP_WEBSITE)
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Let the world know if there hasn't been a publish
|
||||
if not published:
|
||||
print("The site wasn't build because there was no publish trigger, nor was it forced.")
|
||||
# create preview version
|
||||
build_site(WEBSITE_PREVIEW, TMP_WEBSITE_PREVIEW, branch=BRANCH, hugo_environment='preview')
|
||||
build_site(WEBSITE_PREVIEW, TMP_WEBSITE_PREVIEW, branch=PREVIEW_BRANCH, hugo_environment='preview')
|
||||
|
||||
# @TODO: link the library
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
|||
{{ if eq hugo.Environment "gitea" }}
|
||||
{{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }}
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
{{ else if .Site.IsServer }}
|
||||
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
{{ else }}
|
||||
{{ $flist := newScratch }}
|
||||
{{ $flist.Set "initial" "nop" }}
|
||||
|
@ -21,7 +21,7 @@
|
|||
{{ if in $css "css" }}
|
||||
<link rel="stylesheet" href="{{ "/css/" }}{{ $css }}">
|
||||
{{ else }}
|
||||
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue