Skip to content

Commit

Permalink
CORS and Polish lang (#126)
Browse files Browse the repository at this point in the history
I propose adding `crossorigin=anonymous`  for signed stylesheets to allow for CORS policy. 

Practical example - I keep my web page in S3 bucket and redirect both naked domain and www domain into the same bucket (this is rare scenario - most people duplicate buckets). 

So I had to enable CORS like in [this article](https://medium.com/@Keithweaver_/only-allowing-access-to-your-s3-bucket-via-your-website-5ca5c8546152) However CORS cannot be used without crossorigin=anonymous set. (explained [here](https://stackoverflow.com/questions/32039568/what-are-the-integrity-and-crossorigin-attributes)

Also added pl.toml for Polish language.
  • Loading branch information
chew-z authored and hanzei committed Jan 25, 2019
1 parent 5bba25c commit 9b49548
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions i18n/pl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[404_title]
other = "404"
[404_description]
other = "Oops! Ta strona nie istnieje! Albo trafiłeś na błąd {{ with .Site.Params.email }} (w takim wypadku, [powiadom mnie](mailto:{{ . }}) ) {{ end }} albo próbujesz wejść na stronę, której nie ma."
[index_projects_allProjects]
other = "Wszystkie projekty"
[index_blog_latestPosts]
other = "Ostatnie posty"
[index_blog_allPosts]
other = "Wszystkie posty"
[index_blog_readMore]
other = "Więcej"
[index_currentTime]
other = "Mój lokalny czas to"
[nav_backToSection]
other = "Wróć do {{ .Title }}"
[nav_main]
other = "główna"
[blog_readingTime]
one = "{{ .Count }} minut"
other = "{{ .Count }} minut"
[blog_shareThis]
other = "Podziel się"
[footer_text]
other = "[**Introduction**](https://github.com/vickylai/hugo-theme-introduction/) szablon dla [Hugo](http://gohugo.io/). Stworzony z [<i class=\"fa fa-heart\"></i> i <i class=\"fa fa-coffee\"></i>](https://vickylai.com) przez społeczność open source."
2 changes: 1 addition & 1 deletion layouts/partials/css/owlCarousel.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $owlCarousel := resources.Get "vendor/owlCarousel/owl.carousel.min.css" }}
{{ $owlCarouselTheme := resources.Get "vendor/owlCarousel/owl.theme.default.min.css" }}
{{ $owlCarouselBundle := slice $owlCarousel $owlCarouselTheme | resources.Concat "/styles/owlCarousel.min.css" | fingerprint }}
<link rel="stylesheet" href="{{ $owlCarouselBundle.Permalink }}" integrity="{{ $owlCarouselBundle.Data.Integrity }}" media="screen">
<link rel="stylesheet" href="{{ $owlCarouselBundle.Permalink }}" integrity="{{ $owlCarouselBundle.Data.Integrity }}" crossorigin="anonymous" media="screen">
4 changes: 2 additions & 2 deletions layouts/partials/head/css.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
{{ $cssOpts := (dict "targetPath" "/css/main.css" ) }}
{{ $postCSSOpts := (dict "use" "autoprefixer" ) }}
{{ $bundle := $bundleRaw | toCSS $cssOpts | postCSS $postCSSOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" media="screen">
<link rel="stylesheet" href="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" crossorigin="anonymous" media="screen">
{{ end }}

<!-- Custom css -->
{{ range .Site.Params.customCSS -}}
{{ $style := resources.Get . }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" media="screen">
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen">
{{- end }}

0 comments on commit 9b49548

Please sign in to comment.