Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :jekyll_plugins do
gem 'jekyll-include-cache'
gem 'jekyll-sitemap'
gem 'jekyll-liquify'
gem 'jekyll-redirect-from'

# No need this gem because we build by GitHub Actions and serve on Pages.
# gem 'github-pages'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ GEM
liquid
logger
redcarpet
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.1.0)
sass-embedded (~> 1.75)
jekyll-sitemap (1.4.0)
Expand Down Expand Up @@ -218,6 +220,7 @@ DEPENDENCIES
jekyll-feed
jekyll-include-cache
jekyll-liquify
jekyll-redirect-from
jekyll-sitemap
mini_racer
rake
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ registration: https://dojocon-japan.doorkeeper.jp/events/176163
plugins:
- jekyll-feed
- jekyll-include-cache
- jekyll-redirect-from
- jekyll-sitemap # This must be LAST to include contents generated by gems above
- jekyll-liquify # This enable to use variables in frontmatter

Expand Down
3 changes: 2 additions & 1 deletion _posts/2025-07-21-contest-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
layout: post
title: DojoCon Japan 2025 プログラミングコンテスト 参加規約
date: 2025-07-21T00:00:00 UTC+09:00
permalink: /contests/terms.html
permalink: /contests/terms/
redirect_from: /contests/terms.html
---
<img src="/img/common/coderdojo-nameplate.webp" loading="lazy" alt="DojoCon Japan Cover Photo"
title="DojoCon Japan Cover Photo" class="mb-4" />
Expand Down
3 changes: 2 additions & 1 deletion _posts/2025-08-02-contest-how-to-apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ title-in-news-list: 『DojoCon Japan 2025 プログラミングコンテスト
date: 2025-08-02T01:00:00 UTC+09:00
categories: news
tags: 企画
permalink: /contests/how-to-apply.html
permalink: /contests/how-to-apply/
redirect_from: /contests/how-to-apply.html
---
<style>
img {
Expand Down
37 changes: 37 additions & 0 deletions test-directory-structure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
from html.parser import HTMLParser
from pathlib import Path

"""
Expand All @@ -12,6 +13,39 @@
"""


class Parser(HTMLParser):
"""
<meta http-equiv="refresh"> を含むファイルを検査の対象から除外する
"""

def __init__(self, *, convert_charrefs: bool = True) -> None:
super().__init__(convert_charrefs=convert_charrefs)
self.is_redirect = False

def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
if self.is_redirect:
return

if tag != "meta":
return

for attr_name, attr_value in attrs:
if attr_name == "http-equiv" and attr_value == "refresh":
self.is_redirect = True
break


def is_redirect(path: str) -> bool:
with open(path) as fp:
content = fp.read()

parser = Parser()
parser.feed(content)
parser.close()

return parser.is_redirect


def main() -> int:
allowed_names = ["index.html", "404.html"]
errors = list[str]()
Expand All @@ -25,6 +59,9 @@ def main() -> int:
continue

path = cwd.joinpath(file).as_posix()
if is_redirect(path):
continue

errors.append(path)

if 0 < len(errors):
Expand Down