Skip to content

Commit

Permalink
Add handling of page manifest in macOS app
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Forget committed Feb 4, 2024
1 parent 42dd94d commit 8cbeb99
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 65 deletions.
9 changes: 8 additions & 1 deletion Script Templates/PrepareTemplates/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ static void Main()
{
// Add page to all the catalogs.
var page = new Page(pageName);
var foundManifest = false;
if (File.Exists(Path.Combine(folder, "manifest.json")))
{
var manifestFile = File.ReadAllText(Path.Combine(folder, "manifest.json"));
page.PageName = Newtonsoft.Json.JsonConvert.DeserializeObject<Manifest>(manifestFile)?.PageName;
foundManifest = true;
}
pageCatalog.Pages.Add(page);
templateCatalog.Pages.Add(new TemplatePage(pageName, templates));
hubCatalog.Hubs.Add(new Hub(pageName, templates));
if (!foundManifest)
{
// Hub file (old style) does not include pages with a manifest.
hubCatalog.Hubs.Add(new Hub(pageName, templates));
}
}
}
}
Expand Down Expand Up @@ -92,6 +98,7 @@ private static void ValidateTemplate(string pageName, string fileName, string te
var result = template
.Replace("%%USERNAME%%", "aabbcc")
.Replace("%%PAGENAME%%", "somepage")
.Replace("%%FULLPAGENAME%%", "somepage")
.Replace("%%YOURNAME%%", "ddeeff")
.Replace("%%YOURFIRSTNAME%%", "Gghhii")
.Replace("%%MEMBERLEVEL%%", "VIP Gold member")
Expand Down
4 changes: 2 additions & 2 deletions Script Templates/coffee_ai/comment.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
🏆 Congratulations on your Snap %%MEMBERLEVEL%% feature @%%USERNAME%%
It’s wonderful to see your photo in our gallery! Thanks for sharing it with us and Keep Tagging: #snap_%%PAGENAME%%
🏆 Congratulations on your Snap %%MEMBERLEVEL%% feature @%%USERNAME%%
It’s wonderful to see your photo in our gallery! Thanks for sharing it with us and Keep Tagging: #snap_%%FULLPAGENAME%%
We look forward to seeing more of your work!! ❤️☕️❤️
16 changes: 8 additions & 8 deletions Script Templates/coffee_ai/feature.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
• #snap_%%PAGENAME%% •
• #snap_%%FULLPAGENAME%% •

⭐️ Featured Snap %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️
.
__________________________________
✨CONGRATULATIONS ✨
__________________________________
.
Selected by: @%%YOURNAME%%
%%STAFFLEVEL%% for @snap_%%PAGENAME%%
Selected by: @%%YOURNAME%%
%%STAFFLEVEL%% for @snap_%%PAGENAME%%
.
Join us in our fresh, creative and supportive community on Vero. Please follow @snap_community
Join us in our fresh, creative and supportive community on Vero. Please follow @snap_community
.
CC Snap Community Owner
@snap_owner
CC Snap Community Owner
@snap_owner
.
Please check out @snap_kingdom for more of our Snap_community pages

#latteart #coffee #CoffeeFreak #coffee_addict #barista #espresso #Drink #coffeetime #cafe #stilllife #foodphotography #CoffeeBean #latte #flatlay_photography
#morning_coffee #coffeemug #coffeecup #coffeeporn #relaxing #perspective #detail #depthoffield #fireside
#latteart #coffee #CoffeeFreak #coffee_addict #barista #espresso #Drink #coffeetime #cafe #stilllife #foodphotography #CoffeeBean #latte #flatlay_photography
#morning_coffee #coffeemug #coffeecup #coffeeporn #relaxing #perspective #detail #depthoffield #fireside
.
For internal use only!
#snap_%%PAGENAME%%_%%USERNAME%%
Expand Down
38 changes: 0 additions & 38 deletions Script Templates/hubs.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,23 +470,6 @@
}
]
},
{
"name": "coffee copy",
"templates": [
{
"name": "comment",
"template": "🏆 Congratulations on your Snap %%MEMBERLEVEL%% feature @%%USERNAME%% \nIt’s wonderful to see your photo in our gallery! Thanks for sharing it with us and Keep Tagging: #snap_%%PAGENAME%% \nWe look forward to seeing more of your work!! ❤️☕️❤️\n"
},
{
"name": "feature",
"template": "• #snap_%%PAGENAME%% • \n\n⭐️ Featured Snap %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%% \n%%STAFFLEVEL%% for @snap_%%PAGENAME%% \n.\nJoin us in our fresh, creative and supportive community on Vero. Please follow @snap_community \n.\nCC Snap Community Owner \n@snap_owner \n.\nPlease check out @snap_kingdom for more of our Snap_community pages\n\n\n#latteart #coffee #CoffeeFreak #coffee_addict #barista #espresso #Drink #coffeetime #cafe #stilllife #foodphotography #CoffeeBean #latte #flatlay_photography \n#morning_coffee #coffeemug #coffeecup #coffeeporn #relaxing #perspective #detail #depthoffield #fireside \n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%\n.\n"
},
{
"name": "original post",
"template": "✨FEATURE SELECTION ☕️\n"
}
]
},
{
"name": "collage",
"templates": [
Expand Down Expand Up @@ -1314,27 +1297,6 @@
}
]
},
{
"name": "reflection_bnw",
"templates": [
{
"name": "comment",
"template": "✨✨ CONGRATULATIONS!!! ✨✨\n@%%USERNAME%%: You have been featured as part of the @snap_community\n[[PERSONALIZED MESSAGE]]\nThank you for tagging this great photo with #snap_%%PAGENAME%%\n"
},
{
"name": "feature",
"template": "• #snap_%%PAGENAME%% •\n.\n⭐️ Featured %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%%\n%%STAFFLEVEL%% on @snap_%%PAGENAME%%\n.\nJoin us in our fresh, creative and supportive community on Instagram. Please follow @snap_community\n.\nCC Snap Community Owner\n@snap_owner\n.\nPlease check out @snap_kingdom for more of our Snap_community pages.\n\n#snap_community\n#vero\n#verofamily\n#reflections #reflectionphoto #reflectionphotos #reflectionperfection #reflection_addict #mirror #beautifulphotography #beautifulphoto #photooftheday #bestofthe_world #amazingshot #worthafollow #verofriends #verotography #reflections_in_water #reflections_masters #reflection_landscape #reflection_lake #reflection2024 #vero_reflection\n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%.\n.\n"
},
{
"name": "first comment",
"template": "✨✨CONGRATULATIONS!!! ✨\n[[USER'S FIRST NAME]]! Welcome to #snap_reflection! Big Congratulations on a perfect reflection as your first feature in this gallery!\n[[PERSONALIZED MESSAGE]]\nContinue sharing with us using the hashtag, so we won't miss any of your updates @%%USERNAME%%! Cheers!\n✨✨\n"
},
{
"name": "original post",
"template": "✨ Featured by @snap_%%PAGENAME%% ✨\na page out of the @snap_kingdom at the @snap_community"
}
]
},
{
"name": "seasons",
"templates": [
Expand Down
2 changes: 1 addition & 1 deletion Script Templates/pages.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"pages":[{"name":"abandoned"},{"name":"abstract"},{"name":"africa"},{"name":"ai"},{"name":"allblack"},{"name":"allnature"},{"name":"allsports"},{"name":"alltrees"},{"name":"allwhite"},{"name":"architecture"},{"name":"artgallery"},{"name":"asia"},{"name":"australia"},{"name":"beaches"},{"name":"birds"},{"name":"blue"},{"name":"bnw"},{"name":"books"},{"name":"bridges"},{"name":"butterflies"},{"name":"canada"},{"name":"cats"},{"name":"china"},{"name":"cityscape"},{"name":"cocktails"},{"name":"coffee"},{"name":"coffee copy","pageName":"coffee"},{"name":"collage"},{"name":"colorsplash"},{"name":"colours"},{"name":"community_member"},{"name":"country"},{"name":"cuteness"},{"name":"default"},{"name":"depthoffield"},{"name":"drone"},{"name":"drops"},{"name":"edit"},{"name":"europe"},{"name":"fishing"},{"name":"flatlays"},{"name":"flowers"},{"name":"foggy"},{"name":"france"},{"name":"gardening"},{"name":"germany"},{"name":"herpetology"},{"name":"hikes"},{"name":"homestyle"},{"name":"horses"},{"name":"india"},{"name":"insects"},{"name":"ireland"},{"name":"kitchen"},{"name":"landscape"},{"name":"lighthouses"},{"name":"longexposure"},{"name":"macro"},{"name":"minimal"},{"name":"mobile"},{"name":"moody"},{"name":"mountains"},{"name":"nightshots"},{"name":"nordic"},{"name":"numbers"},{"name":"oceanlife"},{"name":"people"},{"name":"pets"},{"name":"potd"},{"name":"reflection"},{"name":"reflection_bnw","pageName":"reflection"},{"name":"seasons"},{"name":"silhouette"},{"name":"skies"},{"name":"street"},{"name":"surreal"},{"name":"symmetry"},{"name":"tattoos"},{"name":"thailand"},{"name":"toys"},{"name":"transports"},{"name":"uae"},{"name":"uk"},{"name":"usa"},{"name":"waters"},{"name":"weddings"},{"name":"wildlife"},{"name":"world"},{"name":"writings"},{"name":"_sat_door_day"}]}
{"pages":[{"name":"abandoned"},{"name":"abstract"},{"name":"africa"},{"name":"ai"},{"name":"allblack"},{"name":"allnature"},{"name":"allsports"},{"name":"alltrees"},{"name":"allwhite"},{"name":"architecture"},{"name":"artgallery"},{"name":"asia"},{"name":"australia"},{"name":"beaches"},{"name":"birds"},{"name":"blue"},{"name":"bnw"},{"name":"books"},{"name":"bridges"},{"name":"butterflies"},{"name":"canada"},{"name":"cats"},{"name":"china"},{"name":"cityscape"},{"name":"cocktails"},{"name":"coffee"},{"name":"coffee_ai","pageName":"coffee"},{"name":"collage"},{"name":"colorsplash"},{"name":"colours"},{"name":"community_member"},{"name":"country"},{"name":"cuteness"},{"name":"default"},{"name":"depthoffield"},{"name":"drone"},{"name":"drops"},{"name":"edit"},{"name":"europe"},{"name":"fishing"},{"name":"flatlays"},{"name":"flowers"},{"name":"foggy"},{"name":"france"},{"name":"gardening"},{"name":"germany"},{"name":"herpetology"},{"name":"hikes"},{"name":"homestyle"},{"name":"horses"},{"name":"india"},{"name":"insects"},{"name":"ireland"},{"name":"kitchen"},{"name":"landscape"},{"name":"lighthouses"},{"name":"longexposure"},{"name":"macro"},{"name":"minimal"},{"name":"mobile"},{"name":"moody"},{"name":"mountains"},{"name":"nightshots"},{"name":"nordic"},{"name":"numbers"},{"name":"oceanlife"},{"name":"people"},{"name":"pets"},{"name":"potd"},{"name":"reflection"},{"name":"reflection_bnw","pageName":"reflection"},{"name":"seasons"},{"name":"silhouette"},{"name":"skies"},{"name":"street"},{"name":"surreal"},{"name":"symmetry"},{"name":"tattoos"},{"name":"thailand"},{"name":"toys"},{"name":"transports"},{"name":"uae"},{"name":"uk"},{"name":"usa"},{"name":"waters"},{"name":"weddings"},{"name":"wildlife"},{"name":"world"},{"name":"writings"},{"name":"_sat_door_day"}]}
2 changes: 1 addition & 1 deletion Script Templates/reflection_bnw/comment.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
✨✨ CONGRATULATIONS!!! ✨✨
@%%USERNAME%%: You have been featured as part of the @snap_community
[[PERSONALIZED MESSAGE]]
Thank you for tagging this great photo with #snap_%%PAGENAME%%
Thank you for tagging this great photo with #snap_%%FULLPAGENAME%%
2 changes: 1 addition & 1 deletion Script Templates/reflection_bnw/feature.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
• #snap_%%PAGENAME%% •
• #snap_%%FULLPAGENAME%% •
.
⭐️ Featured %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️
.
Expand Down
2 changes: 1 addition & 1 deletion Script Templates/reflection_bnw/first comment.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
✨✨CONGRATULATIONS!!! ✨
[[USER'S FIRST NAME]]! Welcome to #snap_reflection! Big Congratulations on a perfect reflection as your first feature in this gallery!
[[USER'S FIRST NAME]]! Welcome to #snap_%%FULLPAGENAME%%! Big Congratulations on a perfect reflection as your first feature in this gallery!
[[PERSONALIZED MESSAGE]]
Continue sharing with us using the hashtag, so we won't miss any of your updates @%%USERNAME%%! Cheers!
✨✨
12 changes: 6 additions & 6 deletions Script Templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,15 @@
]
},
{
"name": "coffee copy",
"name": "coffee_ai",
"templates": [
{
"name": "comment",
"template": "🏆 Congratulations on your Snap %%MEMBERLEVEL%% feature @%%USERNAME%% \nIt’s wonderful to see your photo in our gallery! Thanks for sharing it with us and Keep Tagging: #snap_%%PAGENAME%% \nWe look forward to seeing more of your work!! ❤️☕️❤️\n"
"template": "🏆 Congratulations on your Snap %%MEMBERLEVEL%% feature @%%USERNAME%%\nIt’s wonderful to see your photo in our gallery! Thanks for sharing it with us and Keep Tagging: #snap_%%FULLPAGENAME%%\nWe look forward to seeing more of your work!! ❤️☕️❤️\n"
},
{
"name": "feature",
"template": "• #snap_%%PAGENAME%% • \n\n⭐️ Featured Snap %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%% \n%%STAFFLEVEL%% for @snap_%%PAGENAME%% \n.\nJoin us in our fresh, creative and supportive community on Vero. Please follow @snap_community \n.\nCC Snap Community Owner \n@snap_owner \n.\nPlease check out @snap_kingdom for more of our Snap_community pages\n\n\n#latteart #coffee #CoffeeFreak #coffee_addict #barista #espresso #Drink #coffeetime #cafe #stilllife #foodphotography #CoffeeBean #latte #flatlay_photography \n#morning_coffee #coffeemug #coffeecup #coffeeporn #relaxing #perspective #detail #depthoffield #fireside \n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%\n.\n"
"template": "• #snap_%%FULLPAGENAME%% •\n\n⭐️ Featured Snap %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%%\n%%STAFFLEVEL%% for @snap_%%PAGENAME%%\n.\nJoin us in our fresh, creative and supportive community on Vero. Please follow @snap_community\n.\nCC Snap Community Owner\n@snap_owner\n.\nPlease check out @snap_kingdom for more of our Snap_community pages\n\n\n#latteart #coffee #CoffeeFreak #coffee_addict #barista #espresso #Drink #coffeetime #cafe #stilllife #foodphotography #CoffeeBean #latte #flatlay_photography\n#morning_coffee #coffeemug #coffeecup #coffeeporn #relaxing #perspective #detail #depthoffield #fireside\n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%\n.\n"
},
{
"name": "original post",
Expand Down Expand Up @@ -1319,15 +1319,15 @@
"templates": [
{
"name": "comment",
"template": "✨✨ CONGRATULATIONS!!! ✨✨\n@%%USERNAME%%: You have been featured as part of the @snap_community\n[[PERSONALIZED MESSAGE]]\nThank you for tagging this great photo with #snap_%%PAGENAME%%\n"
"template": "✨✨ CONGRATULATIONS!!! ✨✨\n@%%USERNAME%%: You have been featured as part of the @snap_community\n[[PERSONALIZED MESSAGE]]\nThank you for tagging this great photo with #snap_%%FULLPAGENAME%%\n"
},
{
"name": "feature",
"template": "• #snap_%%PAGENAME%% •\n.\n⭐️ Featured %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%%\n%%STAFFLEVEL%% on @snap_%%PAGENAME%%\n.\nJoin us in our fresh, creative and supportive community on Instagram. Please follow @snap_community\n.\nCC Snap Community Owner\n@snap_owner\n.\nPlease check out @snap_kingdom for more of our Snap_community pages.\n\n#snap_community\n#vero\n#verofamily\n#reflections #reflectionphoto #reflectionphotos #reflectionperfection #reflection_addict #mirror #beautifulphotography #beautifulphoto #photooftheday #bestofthe_world #amazingshot #worthafollow #verofriends #verotography #reflections_in_water #reflections_masters #reflection_landscape #reflection_lake #reflection2024 #vero_reflection\n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%.\n.\n"
"template": "• #snap_%%FULLPAGENAME%% •\n.\n⭐️ Featured %%MEMBERLEVEL%%: @%%USERNAME%% ⭐️\n.\n__________________________________\n✨CONGRATULATIONS ✨\n__________________________________\n.\nSelected by: @%%YOURNAME%%\n%%STAFFLEVEL%% on @snap_%%PAGENAME%%\n.\nJoin us in our fresh, creative and supportive community on Instagram. Please follow @snap_community\n.\nCC Snap Community Owner\n@snap_owner\n.\nPlease check out @snap_kingdom for more of our Snap_community pages.\n\n#snap_community\n#vero\n#verofamily\n#reflections #reflectionphoto #reflectionphotos #reflectionperfection #reflection_addict #mirror #beautifulphotography #beautifulphoto #photooftheday #bestofthe_world #amazingshot #worthafollow #verofriends #verotography #reflections_in_water #reflections_masters #reflection_landscape #reflection_lake #reflection2024 #vero_reflection\n.\n For internal use only!\n#snap_%%PAGENAME%%_%%USERNAME%%\n#snap_featured_%%USERNAME%%.\n.\n"
},
{
"name": "first comment",
"template": "✨✨CONGRATULATIONS!!! ✨\n[[USER'S FIRST NAME]]! Welcome to #snap_reflection! Big Congratulations on a perfect reflection as your first feature in this gallery!\n[[PERSONALIZED MESSAGE]]\nContinue sharing with us using the hashtag, so we won't miss any of your updates @%%USERNAME%%! Cheers!\n✨✨\n"
"template": "✨✨CONGRATULATIONS!!! ✨\n[[USER'S FIRST NAME]]! Welcome to #snap_%%FULLPAGENAME%%! Big Congratulations on a perfect reflection as your first feature in this gallery!\n[[PERSONALIZED MESSAGE]]\nContinue sharing with us using the hashtag, so we won't miss any of your updates @%%USERNAME%%! Cheers!\n✨✨\n"
},
{
"name": "original post",
Expand Down
2 changes: 1 addition & 1 deletion VSCode/syntaxes/scriptTemplate.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"autofields": {
"patterns": [{
"name" : "meta.tag.auto.scriptTemplate",
"match" : "\\%\\%(PAGENAME|USERNAME|MEMBERLEVEL|YOURNAME|YOURFIRSTNAME|STAFFLEVEL)\\%\\%",
"match" : "\\%\\%(PAGENAME|FULLPAGENAME|USERNAME|MEMBERLEVEL|YOURNAME|YOURFIRSTNAME|STAFFLEVEL)\\%\\%",
"captures" : {
"1" : { "name" : "variable.other.constant" }
}
Expand Down
4 changes: 2 additions & 2 deletions Vero Scripts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20;
CURRENT_PROJECT_VERSION = 21;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Vero Scripts/Preview Content\"";
DEVELOPMENT_TEAM = 7U6K972H9Q;
Expand Down Expand Up @@ -311,7 +311,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20;
CURRENT_PROJECT_VERSION = 21;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Vero Scripts/Preview Content\"";
DEVELOPMENT_TEAM = 7U6K972H9Q;
Expand Down
Binary file not shown.
Loading

0 comments on commit 8cbeb99

Please sign in to comment.