Add feature banners and commission button to gallery page

This commit is contained in:
Joshua Goins 2023-03-29 08:57:55 -04:00
parent 87b9544ef8
commit 0f88ab1315
5 changed files with 31 additions and 2 deletions

View file

@ -2,6 +2,8 @@
title: Art title: Art
layout: art layout: art
summary: My personal art gallery. summary: My personal art gallery.
new_banner: You can now vote on artwork!
commissions: true
aliases: aliases:
- /gallery - /gallery
featured: featured:

View file

@ -3,5 +3,7 @@
"gamingforone", "gamingforone",
"goinghome", "goinghome",
"orbit-correction" "orbit-correction"
] ],
"new-banner": "You can now vote on artwork!",
"commissions": true
} }

View file

@ -93,6 +93,8 @@ year_stats = {}
total_art = 0 total_art = 0
character_stats = {} character_stats = {}
tag_stats = {} tag_stats = {}
new_banner = ""
comissions_enabled = False
for filename in os.listdir(art_data_directory): for filename in os.listdir(art_data_directory):
f = os.path.join(art_data_directory, filename) f = os.path.join(art_data_directory, filename)
@ -140,6 +142,11 @@ with open('../data/art-config.json', 'r') as f:
featured_pieces = json_data["featured"] featured_pieces = json_data["featured"]
if "new-banner" in json_data:
new_banner = json_data["new-banner"]
comissions_enabled = json_data["commissions"]
with open(art_output_directory + '/_index.md', 'w') as f: with open(art_output_directory + '/_index.md', 'w') as f:
f.write('---\n') f.write('---\n')
@ -148,6 +155,9 @@ with open(art_output_directory + '/_index.md', 'w') as f:
write_field(f, 'summary', 'My personal art gallery.') write_field(f, 'summary', 'My personal art gallery.')
write_field(f, 'new_banner', new_banner)
write_field(f, 'commissions', str(comissions_enabled).lower())
f.write('aliases:\n') f.write('aliases:\n')
f.write('- /gallery\n') f.write('- /gallery\n')

View file

@ -407,8 +407,15 @@ pre {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
text-align: center; text-align: center;
border: 1px solid black; border: 1px outset black;
border-radius: 5px; border-radius: 5px;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.new-banner {
border: 1px outset black;
border-radius: 5px;
padding: 5px;
text-align: center;
}

View file

@ -6,6 +6,10 @@
{{ $paginator := .Paginate (where .RegularPagesRecursive "Type" "art") }} {{ $paginator := .Paginate (where .RegularPagesRecursive "Type" "art") }}
{{ if eq $paginator.PageNumber 1}} {{ if eq $paginator.PageNumber 1}}
{{ with $.Params.new_banner }}
<div class="new-banner"><b>*new*</b> {{ . }}</div>
{{ end }}
<p>Welcome to my art gallery! I have saved my art since 2016, and this site contains the most complete archive of my work.</p> <p>Welcome to my art gallery! I have saved my art since 2016, and this site contains the most complete archive of my work.</p>
<b>Contains risque art, so you should probably not view this on a work computer.</b> <b>Contains risque art, so you should probably not view this on a work computer.</b>
@ -23,6 +27,10 @@
<a class="art-button" href="/art/characters">Characters</a> <a class="art-button" href="/art/characters">Characters</a>
<a class="art-button" href="/art/tags">Tags</a> <a class="art-button" href="/art/tags">Tags</a>
<a class="art-button" href="/art/stats">Stats</a> <a class="art-button" href="/art/stats">Stats</a>
{{ if $.Params.commissions }}
<a class="art-button" href="/commission">Commissions</a>
{{ end }}
</div> </div>
{{ end }} {{ end }}