Skip to content

Instantly share code, notes, and snippets.

@pfrazee
Last active August 1, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfrazee/896ea5c1b5bc832f73482e1bd2d8bdc1 to your computer and use it in GitHub Desktop.
Save pfrazee/896ea5c1b5bc832f73482e1bd2d8bdc1 to your computer and use it in GitHub Desktop.

For the theme, I'm leaning toward using a template file.

  • The "theme dat" has been mounted to the site's /theme directory.
  • User visits /index.html on the site
    • The /theme/template.html file is loaded.
    • The /index.html file is loaded.
  • Output is constructed:
    • The template <!-- TEMPLATE-CONTENT --> string gets replaced with the content of /index.html
    • The resulting string is served.

This would enable the template to inject css, js, and layout.

<!doctype html>
<html>
<head>
<link rel="stylesheet" href="/theme/theme.css">
<script src="/theme/theme.js"></script>
</head>
<body>
<theme-sidenav></theme-sidenav> <!-- web component defined by theme.js -->
<main>
<!-- TEMPLATE-CONTENT -->
</main>
</body>
</div>
<h1>Hello world</h1>
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="/theme/theme.css">
<script src="/theme/theme.js"></script>
</head>
<body>
<theme-sidenav></theme-sidenav> <!-- web component defined by theme.js -->
<main>
<h1>Hello world</h1>
</main>
</body>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment