This is an automated email from the ASF dual-hosted git repository. grobmeier pushed a commit to branch ms12_restructure_website_2x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit dbf3c273565cb20d4ccaf2bf6d8aabfda24b20ff Author: Christian Grobmeier <[email protected]> AuthorDate: Sun Mar 10 18:48:57 2024 +0100 added doctype template --- src/asciidoc/templates/document.html.erb | 232 +++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) diff --git a/src/asciidoc/templates/document.html.erb b/src/asciidoc/templates/document.html.erb new file mode 100644 index 0000000000..36d13b0bb8 --- /dev/null +++ b/src/asciidoc/templates/document.html.erb @@ -0,0 +1,232 @@ +<%# + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +%> +<%# + Code is based on an example found in this repository: + https://github.com/asciidoctor/asciidoctor-backends/blob/master/erb/html5/document.html.erb +%> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <meta name="generator" content="Asciidoctor <%= attr 'asciidoctor-version' %>"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <% + [:description, :keywords, :author, :copyright].each do |key| + if attr? key %> + <meta name="<%= key %>" content="<%= attr key %>"><% + end + end + %> + <title><%= doctitle(:sanitize => true) || (attr 'untitled-label') %></title> + + <link rel="stylesheet" href="/font-awesome-4.7.0/css/font-awesome.min.css"> + <link rel="stylesheet" href="/css/fonts.css"> + <%= Asciidoctor::Stylesheets.instance.embed_primary_stylesheet %> + <link rel="stylesheet" href="/css/logging-custom.css"> + + <!-- Code Highlighter --> + <%= syntax_highlighter&.docinfo :head, self, {} %> + <%= (docinfo_content = docinfo).empty? ? nil : %(#{docinfo_content}) %> + +</head> +<body> + +<div id="header"> + <div class="logo"> + <a href="/"><img src="/images/log4j-logo.png" alt="Apache Log4j(tm) Logo"/></a> + </div> + + <div class="menu-mobile"> + <i class="fa fa-bars" aria-hidden="true"></i> + </div> + + <div class="navs"> + <div class="menu-mobile-close"> + <i class="fa fa-window-close" aria-hidden="true"></i> + </div> + <nav class="main-menu" aria-label="Main Navigation"> + <ul> + <li><a href="/">About</a></li> + <li><a href="/download.html">Downloads</a></li> + <li> + <a href="#">Learn <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a> + <ul class="menu-drop-down"> +<!-- <li><a href="/getting-started/">Getting Started</a></li>--> +<!-- <li><a href="#">Manual</a></li>--> +<!-- <li><a href="#">Guides</a></li>--> + <li><a href="/legacy-docs.html">Old Docs</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/LOGGING/Log4j">Wiki</a></li> + <li><a href="/articles.html">Articles</a></li> + <li><a href="/faq.html">FAQ</a></li> + </ul> + </li> + <li><a href="#">Develop <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a> + <ul class="menu-drop-down"> + <li><a href="/release-notes.html">Release Notes</a></li> + <li><a href="/components.html">Components</a></li> + <li><a href="/javadoc.html">Javadoc</a></li> + <li><a href="/runtime-dependencies.html">Runtime Dependencies</a></li> + </ul> + </li> + <li><a href="/support.html">Support</a></li> + <li><a href="#">Contribute <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a> + <ul class="menu-drop-down"> + <li><a href="/guidelines.html">Guidelines</a></li> + <li><a href="https://github.com/apache/logging-log4j2">GitHub</a></li> + <li><a href="https://logging.apache.org/team-list.html">Team</a></li> + </ul> + </li> + <li><a href="/security.html">Security</a></li> + </ul> + </nav> + + <nav class="secondary-menu" aria-label="ASF related navigation"> + <ul> + <li> + <a href="#">Apache <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a> + <ul class="menu-drop-down"> + <li><a target="_blank" href="https://www.apache.org/">Home</a></li> + <li><a target="_blank" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> + <li><a target="_blank" href="https://www.apache.org/licenses/">License</a></li> + <li><a target="_blank" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> + <li><a target="_blank" href="https://www.apache.org/events/current-event.html">Current Events</a></li> + <li><a target="_blank" href="https://www.apache.org/security/">Security</a></li> + <li><a target="_blank" href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy</a></li> + </ul> + </li> + <li><a href="https://logging.apache.org">Logging Services</a></li> + </ul> + </nav> + </div> +</div> + +<div class="content-container"> + <% + if (attr? :toc) && (attr? 'toc-placement', 'auto') %> + <div class="table-of-content"> + + <div class="table-of-content-title" id="toctitle"><%= attr 'toc-title' %></div> + <%= converter.convert self, 'outline' %> + </div><% + end + %> + + <div id="content"> + <h1><%= doctitle %></h1> + <%= content %> + </div><% + unless !footnotes? || attr?(:nofootnotes) %> + <div id="footnotes"> + <hr><% + footnotes.each do |fn| %> + <div class="footnote" id="_footnote_<%= fn.index %>"> + <a href="#_footnoteref_<%= fn.index %>"><%= fn.index %></a>. <%= fn.text %> + </div><% + end %> + </div><% + end %> +</div> +<% unless nofooter %> + <div id="footer"> + <div class="footer-text"> + <div> + <% + if attr? :revnumber %> + <%= %(#{attr 'version-label'} #{attr :revnumber}) %><br><% + end + if attr? 'last-update-label' %> + <%= %(#{attr 'last-update-label'} #{attr :docdatetime}) %><% + end %><%= (docinfo_content = (docinfo :footer)).empty? ? nil : %( + #{docinfo_content}) %> + </div> + <div> + Copyright © 2017-2024 <a href="http://www.apache.org">The Apache Software Foundation</a>. Licensed under the Apache Software License, Version 2.0 Please read our <a href="https://privacy.apache.org/policies/privacy-policy-public.html">privacy policy</a>. + <br/> + Apache, Chainsaw, log4cxx, Log4j, Log4net, log4php, Flume and the Apache feather logo are trademarks or registered trademarks of The Apache Software Foundation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. + </div> + </div> + </div><% + end %> + +<script> + document.addEventListener('DOMContentLoaded', function() { + const header = document.querySelector('#header'); + const toc = document.querySelector('.table-of-content'); + + window.addEventListener('scroll', function() { + const headerRect = header.getBoundingClientRect(); + const rect = toc.getBoundingClientRect(); + + if (headerRect.bottom >= 0) { + toc.classList.remove('sticky-effect'); + toc.classList.remove('sticky'); + } else if (rect.top <= 0) { + toc.classList.add('sticky'); + toc.classList.add('sticky-effect'); + } + + }); + }); +</script> +<script> + document.addEventListener('DOMContentLoaded', function () { + var menuIcon = document.querySelector('.menu-mobile'); + var menuIconClose = document.querySelector('.menu-mobile-close'); + var menu = document.querySelector('.navs'); + + var duration = 0.7; + menuIcon.addEventListener('click', function () { + if (menu.classList.contains('menu-open')) { + menu.classList.remove('menu-open'); + } else { + menu.classList.add('menu-open'); + } + }); + + menuIconClose.addEventListener('click', function () { + if (menu.classList.contains('menu-open')) { + menu.classList.remove('menu-open'); + } + }); + }); +</script> +<script> + document.addEventListener('DOMContentLoaded', function() { + var menuItems = document.querySelectorAll('#header nav > ul > li'); + + for (var i = 0; i < menuItems.length; i++) { + menuItems[i].addEventListener('click', function(event) { + // check if the sub menu was clicked + if (event.target.closest('.menu-drop-down')) { + return; + } + + var subMenu = this.getElementsByClassName('menu-drop-down')[0]; + if (subMenu.style.display === 'flex') { + subMenu.style.display = 'none'; + } else { + subMenu.style.display = 'flex'; + } + + // Prevent navigating to '#' link on parent menu item + event.preventDefault(); + }); + } + }); +</script> +</body> +</html> \ No newline at end of file
