{"id":15423627,"url":"https://github.com/travisspomer/staticsitetemplate","last_synced_at":"2025-06-28T11:05:03.365Z","repository":{"id":40801177,"uuid":"272614256","full_name":"TravisSpomer/StaticSiteTemplate","owner":"TravisSpomer","description":"Travis's static site template using Astro","archived":false,"fork":false,"pushed_at":"2024-10-12T03:56:12.000Z","size":1700,"stargazers_count":7,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-19T18:50:34.798Z","etag":null,"topics":["astro","sass","ssg","static-site-generator","template","typescript","website"],"latest_commit_sha":null,"homepage":"","language":"SCSS","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TravisSpomer.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T05:04:59.000Z","updated_at":"2024-09-11T23:30:01.000Z","dependencies_parsed_at":"2024-10-20T05:22:09.181Z","dependency_job_id":"7c881c72-cee0-46bc-878a-abe9db960904","html_url":"https://github.com/TravisSpomer/StaticSiteTemplate","commit_stats":{"total_commits":115,"total_committers":3,"mean_commits":"38.333333333333336","dds":0.4608695652173913,"last_synced_commit":"b5f192243f9a95db69b83792de2de8c14ce88e2c"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/TravisSpomer/StaticSiteTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravisSpomer%2FStaticSiteTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravisSpomer%2FStaticSiteTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravisSpomer%2FStaticSiteTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravisSpomer%2FStaticSiteTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TravisSpomer","download_url":"https://codeload.github.com/TravisSpomer/StaticSiteTemplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TravisSpomer%2FStaticSiteTemplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262419748,"owners_count":23308098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","sass","ssg","static-site-generator","template","typescript","website"],"created_at":"2024-10-01T17:44:03.559Z","updated_at":"2025-06-28T11:05:03.343Z","avatar_url":"https://github.com/TravisSpomer.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Travis's static site template\n\nThis project contains the basic static site template that I use. I've set it up for rapid development and to produce simple, very-high-performance static websites the way that Grandma used to, but with a few extra modern necessities like TypeScript and CSS preprocessing. It produces no JavaScript by default.\n\nThis is a project for my own use and I don't have any plans to elevate it beyond that but you're welcome to take it and build on it from there. (Unless you prefer indenting with spaces, in which case GTFO.)\n\n### **[🆕 Create a website with this template now](https://github.com/TravisSpomer/StaticSiteTemplate/generate)**\n\n## Features\n\n### Astro\n\nThis template is now powered by [Astro](https://astro.build), which handles the dev server and most of the processing.\n\n*\tNo client-side JavaScript is emitted unless you add some.\n*\tYou can create one or more page layouts (templates) for your site to hold your common navigation and page structure.\n*\tYou can create pages in the site by just adding an Astro/HTML or Markdown file to the source tree.\n*\tYou can write your client-side script in TypeScript instead of JavaScript, and it'll be automatically converted.\n*\tYou can include your favorite NPM packages.\n\nSee the [Astro docs](https://astro.build/docs) for information on how to use Astro, though it's quite self-explanatory.\n\n### Enhancements\n\nThis template includes a few things that aren't included in Astro by default:\n\n*\tThe site template and styles include a few opinionated defaults for making beautiful text.\n*\tYour code will be automatically linted and reformatted, ensuring consistent style and eliminating some common mistakes.\n*\tYou can write CSS using the more modern SCSS (Sass) syntax, and it'll be automatically converted.\n*\tIn production builds, HTML is minified for maximum performance.\n*\tWhen paired with the [Azure Static Web Apps](https://azure.microsoft.com/en-us/services/app-service/static/) service or an Azure Blob Storage static website, you automatically get continuous production deployments based on your main Git branch, without ever manually uploading any files.\n\t*\tBut you can use it with any other static site host too by running a single build command and then uploading the contents of the site via FTP.\n\nFor more details on these enhancements, see \"Using the template\" below.\n\n## Environment setup\n\n### Required software\n\nDownload and install the latest stable versions of these products from their websites.\n\n1.\t[Visual Studio Code](https://code.visualstudio.com)\n2.\t[Node](https://nodejs.org/en/)\n\n### Building and running\n\nWhenever picking up a new version of the template, you need to make sure your dependencies are installed. In Visual Studio Code:\n\n1.\tTerminal \u003e New Terminal\n2.\t`npm install`\n\nWhen you're ready to see your site:\n\n1.\t`npm start`\n\nWhen you're ready to produce a minified production build of the site in the `build` folder:\n\n1.\t`npm run build`\n\n## Using the template\n\nHere are some things to know about using this site template.\n\n### Customizing for your site\n\nAt minimum, do this to customize the site for your purposes:\n\n1.\tFind and replace `StaticSiteTemplate` with the name of your site\n2.\tUpdate the `site` canonical URL in [`astro.config.mjs`](astro.config.mjs)\n3.\tUpdate the copyright information in [`src/layouts/*.astro`](src/layouts/)\n4.\tReplace image assets in `static/images/app` with appropriate logos for your site\n5.\tAdd appropriate information to the [app manifest](static/app.webmanifest)\n6.\tGive yourself credit in [`humans.txt`](static/humans.txt)\n\n#### Editing the page layout (template)\n\nThis site template comes with two page layouts:\n\n*\t[`default.astro`](src/layouts/default.astro), which is suitable for most pages and is used whenever a layout is not explicitly chosen by a page.\n*\t[`plain.astro`](src/layouts/plain.astro), which is useful for popup windows and very custom pages that don't want the standard page chrome, but still want the site's CSS.\n\nThere's also [`base.astro`](src/layouts/base.astro), which defines the page skeleton shared by both `default` and `plain`.\n\n### Compatibility\n\nCompatibility with Internet Explorer, Edge Legacy (pre-Chromium), and other non-modern browsers is not a goal. That just applies to the included CSS, though—if you replace my default CSS with something simpler, it would work just fine.\n\n### Stuff you can safely delete\n\nThe template includes a few files that aren't necessary that you can feel free to delete.\n\n*\t`page2.md` is just an example of how to write a page in Markdown and you should delete it.\n*\t`humans.txt` is just for your benefit and is not necessary in any way.\n*\tThe `plain.astro` layout isn't used by anything in the template, and don't need it if you don't decide to use it.\n*\t`staticwebapp.config.json` is only needed if you're deploying to the Azure Static Web Apps service **or** you've changed that file to create client-side redirects.\n\n### Optimization\n\nProduction builds will optimize your HTML, CSS, and JavaScript outputs. If you'd also like to optimize images and other assets, you can use [astro-compress](https://github.com/Lightrix/astro-compress). If you do this you'll probably want to remove the `@frontendista/astro-html-minify` dependency. (I chose that one for this template because it's about 60 MB smaller than `astro-compress`.)\n\n### Creating routes and redirects\n\nUse [`staticwebapp.config.json`](static/staticwebapp.config.json) to configure routes and redirects for the app.\n\nThis file will be copied as-is to the output folder and [used by the Azure Static Web Apps service](https://docs.microsoft.com/en-us/azure/static-web-apps/routes).\n\n#### Example staticwebapp.config.json\n\n```json\n{\n\t\"routes\": [\n\t\t{ \"route\": \"default.aspx\", \"serve\": \"/\", \"statusCode\": 301 }\n\t],\n\t\"responseOverrides\": {\n\t\t\"404\": { \"rewrite\": \"/404/index.html\" }\n\t}\n}\n```\n\n## Deploying to the web\n\nYou have a few options:\n\n### Deploying to Azure Static Web Apps\n\nYou can deploy to Azure Static Web Apps with very minimal configuration:\n\n*\tWhen creating the app in Azure Portal, set the build artifacts folder to `build` (it's empty by default).\n\nOnce your repo and Azure are set up in this way, whenever your default branch is changed, GitHub will automatically build your site and publish it to Azure without any manual steps.\n\n### Deploying to Azure Blob Storage\n\nYou can easily deploy to an Azure Blob Storage static website using GitHub Actions (if your project is on GitHub):\n\n*\t[Generate a SAS URL for your storage account and create a Secret in your repo](https://github.com/marketplace/actions/deploy-to-azure-storage#how-to-get-a-sas-url-and-save-it).\n*\tIn GitHub, open this repo's [`.github/workflows/publish.yml`](.github/workflows/publish.yml), edit it, and uncomment the two `push:` and `branches: [ main ]` lines at the top to enable automatic deployments.\n\t*\tIf you are using `staticwebapp.config.json` to configure redirects, uncomment the \"create redirects\" section and fill in the `canonical-url` property.\n\t*\tIf you prefer, you can manually trigger a deployment from the Actions tab instead of running automatically.\n\nOnce your repo is set up this way, whenever your default branch has changes pushed, GitHub will automatically build your site and publish it to Azure without any manual steps.\n\nTip: You can use my [`deploy-to-azure-storage`](https://github.com/marketplace/actions/deploy-to-azure-storage) Action to automatically deploy static sites built with other templates, too.\n\n### Deploying to any static file host\n\nYou can also deploy the site to any static file host. Just run a production build (`npm run build`; see above) and upload the contents of the `build` folder to a host of your choice.\n\n### Optionally purging an Azure CDN\n\nThe deployment workflow included with this template can also automatically purge an associated Azure CDN endpoint whenever the site's contents change, to minimize the length of time when files are stale. Open [`.github/workflows/publish.yml`](.github/workflows/publish.yml) on github.com, and see the instructions near `ENABLE_CDN_PURGE`. Note that CDN purging requires a separate secret in addition to the `DEPLOY_SAS_URL` secret you already set up.\n\n## Technologies used\n\n*\t[Astro](https://astro.build) for most features, replacing my old Gulp-powered build pipeline.\n*\t[TypeScript](https://www.typescriptlang.org/) for JavaScript transpilation.\n*\t[ESLint](https://eslint.org/) for JavaScript linting and formatting.\n*\t[SCSS (Sass)](https://sass-lang.com/) for CSS preprocessing and minification.\n\nFor more information, including licenses for these packages, check the `node_modules` subfolders.\n\n---\n\nThis template is © 2020-2023 Travis Spomer but released to the public domain under the [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0) license. This license does not apply to sites built with this template, nor to external libraries referenced by this template; only the template itself. It is provided as-is and no warranties are made as to its functionality or suitability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravisspomer%2Fstaticsitetemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravisspomer%2Fstaticsitetemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravisspomer%2Fstaticsitetemplate/lists"}