Skip to content

Commit

Permalink
Progress #23: add site template substitutions to Watson script
Browse files Browse the repository at this point in the history
Also clean up CSS and implement flatpakref file template strings.
  • Loading branch information
aral committed Dec 14, 2021
1 parent 21ca6d5 commit cb38b07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 107 deletions.
16 changes: 8 additions & 8 deletions template/site/com.github.ORG.APP.flatpakref
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[Flatpak Ref]
Name=org.small_tech.comet
Url=https://comet.small-web.org/repo
Name=com.github.{GITHUB.ORG}.{GITHUB.APP}
Url=https://{GITHUB.ORG.ORIGINAL}.github.io/{GITHUB.APP.ORIGINAL}/repo
Branch=stable
Title=Comet
Comment=Write better Git commit messages
Description=A distraction-free Git commit message editor with spell-check, first line character limit warnings, and emoji support.
Icon=https://comet.small-web.org/comet-128.svg
Homepage=https://comet.small-web.org
Title={APP.NAME}
Comment={APP.COMMENT}
Description={APP.DESCRIPTION}
Icon=https://raw.githubusercontent.com/{GITHUB.ORG.ORIGINAL}/{GITHUB.APP.ORIGINAL}/main/data/128.svg
Homepage=https://{GITHUB.ORG.ORIGINAL}.github.io/{GITHUB.APP.ORIGINAL}
IsRuntime=false
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
GPGKey=mQGNBGGwtGoBDACxT53XCAcnMMT4T3AaCg5XY1Ig5SJPrSuZc4so7CeUPayG1YyyvDJMtc4l6q6CFiWw9jXkVbWYEex1CTMq/qJAHWKV++lz/si3YzHchPa/NVLpA8oajabJa1mleAllb5Pi4i6IqXVjWoe74r39apXDZH15QQBaRMiZx+Quf4yDQbIpZO44+wsNbwqsOJYP60QLXMbOX/Xt/hy5ubG3PdEyhKHloS5recmCOzexDzDjDknVmNHM1OBxEQo7D3M7InP0NqOAQEixeMwmdyUX8Jt0bqSecrKQOcN1YeT1e2r/TfYD9dPpT0nMxKPHx+pXF+T9alMFMGREN98sa9vvjU8OFAP0ydSmMWICpU0UMysH7ZcfiP5G2KHyrX3cw6tse8s0aRT4Gu3zs0Gsrqse3YbC+DEWs721kD1gU6Gd+KGAMFs9m6cMDv4I8GskhUSVkITjH/7HvvPnpapcTtiBMTAdeVpB1YEbjFoajo4tia7rKU6YbNsSgvo8HoKrZUHGliMAEQEAAbQTYXJhbEBzbWFsbC10ZWNoLm9yZ4kBzgQTAQoAOBYhBFGnN6sZHjVmY9xw5TnVD3EUlFQMBQJhsLRqAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEDnVD3EUlFQM4M8L/0XILyiUQvdJtmdGjV1AXKYj+4ZY+6Ybt5VUTqcywmP1oWRvmSTH9qUPHCBWFCcMJ6ZcltRf8OjXrLoZH+P5rNMEFA+MuzMtHaI30EvNyOjrRPXulOyYajMyBM+HIv3vYJ0Q/B+4DSLQmMj0GP58dHlWCgMQ2lTIec7sqdjjCVoQMTslLunEUTZWW8SSBT5MYNqtnt1wempVKb/dDquPIWtfitvDPLHLssPP3D+B33/IwQsuiiQneXCsb6BJ3qjc34Mzt6K3S74Ug5HBmp+fyHRIbsJJTF2gNwWsONpMAnLpmEgcCGbo7ej6+wRf8iMbcjaYyGO/b5jEcCVLuFxlv8fLDGrnN0gH0h4+XAX+C27ixBmaR3ZMJ8HQTTayx8nqKEEOW5EeWlB32hIBYJydPTj9sZmNPM6XBubvCYycs77HwJVJCOVxdoFq77WVXSo3FCINp0Q0oYG1OpJ63sH3FKUHoZmfwF+pFRLQqkLk2LrXiiCab6+/zEa0fpanj3DBDA==
GPGKey={GPGKey}
97 changes: 0 additions & 97 deletions template/site/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
html {
background-color: #273445; /* elementary OS Slate 700*/
min-width: 320px;
background-image: url(background.jpg);
background-position: 60% 75%;
background-blend-mode: hard-light;
min-height: 100%;
position: relative;
}
Expand Down Expand Up @@ -165,100 +162,6 @@ h1 {
margin-bottom: 0;
}

/* Wallpaper layer. */

#wallpaper {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-image: url(./comet-wallpaper-4k-by-margo-de-weerdt-small-technology-foundation.jpg);
background-position: 60% 75%;
opacity: 0;
overflow: hidden;
pointer-events: none;
}

#wallpaperInstructions {
z-index: 1;
position: fixed;
width: min(90%, 420px);
max-width: 90%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #fafafa; /* elementary OS Silver 100 */
background-color: rgba(0,0,0,0.66);
padding: 1em;
border-radius: 1em;
}

#wallpaperInstructions h2 {
margin-top: 0;
font-size: 1.25em;
font-weight: normal;
}

#wallpaperInstructions a {
font-size: 1.5em;
}

#wallpaperInstructions img {
width: 100%;
}

#wallpaperInstructions small {
line-height: 1.5em;
}

button {
color: #fafafa; /* elementary OS Silver 100 */
background: transparent;
border: 1px solid #fafafa; /* elementary OS Silver 100 */
padding: 0.5em;
border-radius: 0.5em;
font-size: 1em;
margin-top: 1.75em;
margin-bottom: 0.25em;
margin-left: auto;
margin-right: auto;
cursor:pointer;
display: block;
}

@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}

@keyframes fadeOut {
0% {opacity: 1;}
100% {opacity: 0;}
}

.fadeIn {
animation-duration: 1s;
animation-fill-mode: both;
animation-name: fadeIn;
pointer-events: all !important;
}

.fadeOut {
animation-duration: 1s;
animation-fill-mode: both;
animation-name: fadeOut;
pointer-events: none !important;
}

kbd {
background-color: rgba(255, 255, 255, 0.25);
padding: 0.25em;
padding-bottom: 0.1em;
border-radius: 0.25em;
border: 1px solid rgba(255, 255, 255, 0.5);
}

/*
CSS-only carousel styles based on techniques from
https://css-tricks.com/css-only-carousel/ by Chris Coyier and
Expand Down
2 changes: 1 addition & 1 deletion template/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div id='content'>
<header>
<img id='icon' src='128.svg' alt='{APP.NAME} logo'>
<img id='icon' src='https://raw.githubusercontent.com/{GITHUB.ORG.ORIGINAL}/{GITHUB.APP.ORIGINAL}/main/data/128.svg' alt='{APP.NAME} logo'>

<h1>{APP.NAME}</h1>

Expand Down
4 changes: 3 additions & 1 deletion watson
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ current_step=$(( current_step + 1 ))

# This is the list of files to carry out substituions in.
# These files are all in the template/ directory.
files=('com.github.ORG.APP.yml' 'meson.build' 'README.md' 'src/Widgets/HeaderBar.vala' 'src/Application.vala' 'src/MainWindow.vala' 'data/APP.appdata.xml.in' 'data/APP.desktop.in' 'data/gresource.xml' 'data/gschema.xml' 'po/POTFILES' 'task/build' 'task/install' 'task/package' 'task/preview-in-appcenter' 'task/run' 'task/run-package' 'task/take-screenshots' 'task/update-translations' '.github/workflows/main.yml' '.vscode/launch.json')
files=('com.github.ORG.APP.yml' 'meson.build' 'README.md' 'site/com.github.ORG.APP.flatpakref' 'site/index.html' 'site/README.md' 'src/Widgets/HeaderBar.vala' 'src/Application.vala' 'src/MainWindow.vala' 'data/APP.appdata.xml.in' 'data/APP.desktop.in' 'data/gresource.xml' 'data/gschema.xml' 'po/POTFILES' 'task/build' 'task/install' 'task/package' 'task/preview-in-appcenter' 'task/run' 'task/run-package' 'task/take-screenshots' 'task/update-translations' '.github/workflows/main.yml' '.vscode/launch.json')

# Switch to the template directory.
pushd template
Expand Down Expand Up @@ -221,6 +221,7 @@ current_step=$(( current_step + 1 ))
mv com.github.ORG.APP.yml "com.github.${github_organisation}.${github_app}.yml"
mv data/APP.appdata.xml.in "data/${github_app}.appdata.xml.in"
mv data/APP.desktop.in "data/${github_app}.desktop.in"
mv site/com.github.ORG.APP.flatpakref "site/com.github.${github_organisation}.${github_app}.flatpakref"

# Switch back to the main directory, move all the files in the
# template directory to the main directory (overriding Watson’s
Expand All @@ -229,6 +230,7 @@ mv data/APP.desktop.in "data/${github_app}.desktop.in"
# new app ready to be built in the next step.
popd
mv template/* .
mv template/site .
mv template/.vscode .
mv template/.github .
mv template/.editorconfig .
Expand Down

0 comments on commit cb38b07

Please sign in to comment.