Fetch the git SHA, with packed-refs support, and fallback to HEAD based on https://github.com/getsentry/raven-python/blob/25728c8190a7f008cdb00b1664cd4fd479060eaf/raven/versioning.py#L17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# myapp/management/commands/fix_alias_page_first_last_published.py | |
from django.core.management.base import BaseCommand | |
from django.db.models import Q | |
from wagtail.core.models import Page | |
class Command(BaseCommand): | |
def handle(self, **options): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wagtail.search.backends.elasticsearch7 import ( | |
Elasticsearch7Mapping, | |
Elasticsearch7SearchBackend, | |
Elasticsearch7SearchQueryCompiler, | |
Elasticsearch7SearchResults, | |
) | |
from .index import RootFilterField | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.black] | |
line-length = 120 | |
target-version = ['py38'] | |
exclude = ''' | |
( | |
/( | |
\.eggs # exclude a few common directories in the | |
| \.git # root of the project | |
| \.mypy_cache | |
| \.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish docs to Netlify | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Deploy docs | |
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets up routes and 404 any that match the 404 map | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { | |
let requestURL = new URL(request.url) | |
let path = requestURL.pathname | |
if (should404(path)) { | |
return new Response('Sorry, not found', { | |
status: 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", event => { | |
event.respondWith(fetchAndReplace(event.request)) | |
}) | |
async function fetchAndReplace(request) { | |
let modifiedHeaders = new Headers() | |
modifiedHeaders.set('Content-Type', 'text/html') | |
modifiedHeaders.append('Pragma', 'no-cache') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MkDocs to GitHub Pages | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
deploy: |
NewerOlder