From dcda632f3cf163aae85b09246c993f96ae54e15f Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 11:12:45 +0200 Subject: [PATCH 1/8] Init for toc. --- src/components/TwoCols.astro | 4 +- src/content/config.ts | 1 + src/content/pages/childcare.mdx | 2 +- src/content/pages/prague.mdx | 1 + src/content/pages/terms.mdx | 1 + src/content/pages/venue.mdx | 1 + src/layouts/MarkdownLayout.astro | 33 ++++++++-- src/pages/[...slug].astro | 102 +++++++++++++++++++++++++------ 8 files changed, 120 insertions(+), 25 deletions(-) diff --git a/src/components/TwoCols.astro b/src/components/TwoCols.astro index 6b8cbbdb9..9b5c442d6 100644 --- a/src/components/TwoCols.astro +++ b/src/components/TwoCols.astro @@ -2,10 +2,10 @@ ---
-
+
-
+
diff --git a/src/content/config.ts b/src/content/config.ts index a43d00f8d..295a81fae 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -10,6 +10,7 @@ const pages = defineCollection({ schema: z.object({ title: z.string(), subtitle: z.string(), + toc: z.boolean().optional().default(false), }), }); diff --git a/src/content/pages/childcare.mdx b/src/content/pages/childcare.mdx index c5d9513b7..da5652c1e 100644 --- a/src/content/pages/childcare.mdx +++ b/src/content/pages/childcare.mdx @@ -1,13 +1,13 @@ --- title: Childcare subtitle: Everything you need to know about childcare +toc: true --- import { Image } from 'astro:assets'; import childcareArea from "./images/childcare-area.jpg"; import childcareBalls from "./images/childcare-balls.jpg"; - ## Childcare at EuroPython 2025 We’re committed to making EuroPython as inclusive and accessible as possible — and that includes supporting parents attending the conference. diff --git a/src/content/pages/prague.mdx b/src/content/pages/prague.mdx index db8310aa9..68cdb60dd 100644 --- a/src/content/pages/prague.mdx +++ b/src/content/pages/prague.mdx @@ -1,6 +1,7 @@ --- title: About Prague subtitle: Everything you need to know about traveling to, getting around, and enjoying the city. +toc: true --- import { Image } from "astro:assets"; diff --git a/src/content/pages/terms.mdx b/src/content/pages/terms.mdx index 4bea3919b..ef9b8a521 100644 --- a/src/content/pages/terms.mdx +++ b/src/content/pages/terms.mdx @@ -1,6 +1,7 @@ --- title: Terms and Conditions subtitle: These terms and conditions apply to all attendees, sponsors and other participants in the EuroPython 2025 conference. +toc: true --- # Terms & Conditions diff --git a/src/content/pages/venue.mdx b/src/content/pages/venue.mdx index 0dd9a545a..b1d04d9e9 100644 --- a/src/content/pages/venue.mdx +++ b/src/content/pages/venue.mdx @@ -1,6 +1,7 @@ --- title: Venue subtitle: EuroPython 2025 will be back in Prague! +toc: true --- import { Image } from "astro:assets"; diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index 6ff28280c..4842284a5 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -2,16 +2,41 @@ import Layout from "@layouts/Layout.astro"; import Section from "@ui/Section.astro"; import Prose from "@components/prose/prose.astro"; +import TwoCols from "@components/TwoCols.astro"; +import { marked } from 'marked'; import "../styles/markdown.css"; -const { title, description } = Astro.props; +const { title, description, toc=false } = Astro.props; + +import remarkToc from 'remark-toc' + +//const html0 = marked.parse(Astro.slots.render); +const html = await Astro.slots.render('default'); + + //html.use(remarkToc) + //.process(await read('src/content/pages/childcare.mdx')) + ---
- - - + { toc ? + + + + + + + +
+ + + : + + + + } +
diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index 8e778da48..f9163e4c2 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -1,6 +1,6 @@ --- import { type CollectionEntry, getCollection } from "astro:content"; -import Layout from "@layouts/MarkdownLayout.astro"; +import Layout from "@layouts/SectionLayout.astro"; import ButtonLink from "../components/button-link/button-link.astro"; import { Separator } from "../components/separator/separator"; @@ -15,6 +15,10 @@ import { Note } from "../components/note"; import SponsorTiers from "../components/sponsor-tiers/sponsor-tiers.astro"; import Accordion from "../components/accordion/accordion.astro"; +import TwoCols from "@components/TwoCols.astro"; +import Prose from "@components/prose/prose.astro"; +import Headline from "@components/ui/Headline.astro"; + export async function getStaticPaths() { const pages = await getCollection("pages"); @@ -46,21 +50,83 @@ let title = const description = post.data.subtitle; --- - - + + + { post.data.toc ? + +
aaa
+ + +
+
+ + + + + +
+ : + + + + }
+ + From 67ecf2c8c57aea06c28b93c192b524406fd432e3 Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 12:18:32 +0200 Subject: [PATCH 2/8] Update toc with active section. --- src/content/config.ts | 2 +- src/pages/[...slug].astro | 101 +++++++++++++++++++++++++++++++++++--- 2 files changed, 94 insertions(+), 9 deletions(-) diff --git a/src/content/config.ts b/src/content/config.ts index 79130a80e..46e052fb5 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -10,7 +10,7 @@ const pages = defineCollection({ schema: z.object({ title: z.string(), subtitle: z.string(), - toc: z.boolean().optional().default(false), + toc: z.boolean().optional().default(true), }), }); diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index f9163e4c2..a81734508 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -54,9 +54,8 @@ const description = post.data.subtitle; { post.data.toc ? -
aaa
- +
@@ -107,26 +106,112 @@ document.addEventListener("DOMContentLoaded", () => { const tocContainer = document.getElementById("toc"); if (!tocContainer) return; - const headings = document.querySelectorAll("article h2, article h3"); + const headings = Array.from(document.querySelectorAll("article h2, article h3, article h4")); if (!headings.length) return; - const ul = document.createElement("ul"); + const rootUl = document.createElement("ul"); + let currentUl = rootUl; + let lastLevel = 2; + const parents = [rootUl]; headings.forEach((heading, index) => { if (!heading.id) { heading.id = `heading-${index}`; } + const level = parseInt(heading.tagName[1], 10); const li = document.createElement("li"); - li.style.marginLeft = heading.tagName === "H3" ? "1em" : "0"; const a = document.createElement("a"); a.href = `#${heading.id}`; a.textContent = heading.textContent; - li.appendChild(a); - ul.appendChild(li); + + if (level > lastLevel) { + const newUl = document.createElement("ul"); + parents[parents.length - 1].lastElementChild?.appendChild(newUl); + parents.push(newUl); + } else if (level < lastLevel) { + parents.splice(-(lastLevel - level)); + } + + currentUl = parents[parents.length - 1]; + currentUl.appendChild(li); + lastLevel = level; }); - tocContainer.appendChild(ul); + tocContainer.appendChild(rootUl); + + // Scroll spy: highlight active link + const observer = new IntersectionObserver( + entries => { + entries.forEach(entry => { + const id = entry.target.id; + const tocLink = tocContainer.querySelector(`a[href="#${id}"]`); + if (tocLink) { + if (entry.isIntersecting) { + tocContainer.querySelectorAll("a").forEach(a => a.classList.remove("active")); + tocLink.classList.add("active"); + } + } + }); + }, + { + rootMargin: "-30% 0px -60% 0px", // adjust when to highlight + threshold: 0, + } + ); + + headings.forEach(heading => observer.observe(heading)); }); + + From 469163392d5298a04f72726bea66fc27aa9c5dd8 Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 13:20:08 +0200 Subject: [PATCH 3/8] Update content. --- src/components/TwoCols.astro | 2 +- src/content/pages/beginners-day.mdx | 8 +++--- src/content/pages/childcare.mdx | 2 +- src/content/pages/faq.mdx | 1 + src/content/pages/prague.mdx | 1 - src/content/pages/programme/tracks.mdx | 32 +++++++++++------------ src/content/pages/sponsorship/sponsor.mdx | 1 + src/content/pages/terms.mdx | 1 - src/content/pages/tickets.mdx | 1 + src/content/pages/venue.mdx | 1 - src/pages/[...slug].astro | 27 ++++++++++++++++--- src/styles/global.css | 5 +++- 12 files changed, 52 insertions(+), 30 deletions(-) diff --git a/src/components/TwoCols.astro b/src/components/TwoCols.astro index 226a3fe3a..3669e3347 100644 --- a/src/components/TwoCols.astro +++ b/src/components/TwoCols.astro @@ -5,7 +5,7 @@
-
+
diff --git a/src/content/pages/beginners-day.mdx b/src/content/pages/beginners-day.mdx index 4bbcb6777..910040b70 100644 --- a/src/content/pages/beginners-day.mdx +++ b/src/content/pages/beginners-day.mdx @@ -11,7 +11,7 @@ On **Saturday 19th July**, we'll be hosting a day to help introduce people to pr EuroPython Beginners' Day is open to everyone, from high school students to late career changers. Entry is free for EuroPython ticket holders (any ticket type), and €5 otherwise. Tickets for the Beginners' Day can be purchased through the [tickets page](https://ep2025.europython.eu/tickets/). -#### How to sign up for the Beginners' day and choose your track? +## How to sign up for the Beginners' day and choose your track? Applications are open until May 11th, and successful applicants will be notified by May 18th. Entry is free for EuroPython ticket holders and €5 otherwise. The number of places available for each track is as follows: @@ -28,7 +28,7 @@ The number of places available for each track is as follows:
-### Beginners' Day Unconference +## Beginners' Day Unconference The Beginners' Day Unconference is designed to help you start and grow your tech career. On the day, you'll be able to: * Attend panel discussions where junior developers share their real-world experiences, hiring managers explain what they look for in candidates, and experienced developers discuss the journey from junior to senior roles; @@ -38,7 +38,7 @@ The Beginners' Day Unconference is designed to help you start and grow your tech Whether you're considering a career change, looking for your first tech role, or wanting to advance your early career, these collaborative sessions provide insights and advice from people who've been in your shoes. -### Django Girls +## Django Girls Django Girls is a welcoming, hands-on workshop designed specifically for women and other underrepresented groups with little to no previous programming experience. Throughout this full-day session, participants will build their very own web application using Python and Django, guided by experienced mentors who provide personalized support every step of the way. The workshop follows a carefully designed curriculum that makes web development accessible and fun, creating a supportive environment where beginners can ask questions, experiment, and celebrate their progress together. @@ -52,7 +52,7 @@ We are also looking for **mentors** for Django Girls. Applications for mentors c
-### Humble Data +## Humble Data Humble Data is an inclusive, beginner-friendly workshop that introduces participants to data science using Python. It is aimed at people from underrepresented groups in tech but is open to everyone. Throughout this interactive session, you'll learn essential Python programming concepts while exploring real-world datasets, creating visualizations, and discovering patterns through analysis. Experienced mentors will guide you through each step, from setting up your environment to implementing data analysis techniques. The workshop emphasizes a hands-on approach where you'll actively work with tools like Jupyter notebooks, pandas, and matplotlib in a supportive, collaborative atmosphere. diff --git a/src/content/pages/childcare.mdx b/src/content/pages/childcare.mdx index 17bb527b4..2897805a9 100644 --- a/src/content/pages/childcare.mdx +++ b/src/content/pages/childcare.mdx @@ -21,7 +21,7 @@ If you prefer, you can hire a professional nanny at your own cost through our ch We’ll also have an area available for breastfeeding or spending time with your child in a calmer environment. -### How to Apply +## How to Apply To request childcare, please make sure to: - Register your own ticket for the conference. - During checkout, select that you’ll need childcare. diff --git a/src/content/pages/faq.mdx b/src/content/pages/faq.mdx index 85d282b6d..4bfee6de9 100644 --- a/src/content/pages/faq.mdx +++ b/src/content/pages/faq.mdx @@ -32,6 +32,7 @@ subtitle: Frequently Asked Questions about EuroPython
  • **September 2025** EuroPython 2025 Videos published
  • +## Questions EuroPython 2025 will take place on **14 – 20 July 2025**. Mark your calendars! diff --git a/src/content/pages/prague.mdx b/src/content/pages/prague.mdx index 68cdb60dd..db8310aa9 100644 --- a/src/content/pages/prague.mdx +++ b/src/content/pages/prague.mdx @@ -1,7 +1,6 @@ --- title: About Prague subtitle: Everything you need to know about traveling to, getting around, and enjoying the city. -toc: true --- import { Image } from "astro:assets"; diff --git a/src/content/pages/programme/tracks.mdx b/src/content/pages/programme/tracks.mdx index 63c73d59a..7a920d914 100644 --- a/src/content/pages/programme/tracks.mdx +++ b/src/content/pages/programme/tracks.mdx @@ -4,40 +4,40 @@ subtitle: EuroPython 2025 will feature a wide range of tracks, covering many asp --- # Programme Tracks for EuroPython 2025 -### Python Core, Internals, Extensions +## Python Core, Internals, Extensions Proposals related to the foundation of Python and developments to extend and build upon the language. -### Web Development, Web APIs, Front-End Integration +## Web Development, Web APIs, Front-End Integration Proposals related to the development of interfaces seen and used by humans and computers. -### DevOps, Cloud, Scalable Infrastructure +## DevOps, Cloud, Scalable Infrastructure Proposals related to the running Python-based systems. What we do to bring programs into production, keep them alive and maintain them. -### IoT, Embedded Systems, Hardware Integration +## IoT, Embedded Systems, Hardware Integration Proposals related to running Python-derived software on the smallest devices with limited resources available. -### Tooling, Packaging, Developer Productivity +## Tooling, Packaging, Developer Productivity Proposals related to ease Python-related development, getting the product into a package, and how to automate most of the process from development via QA until the package is in a repository or even updated in production. -### Testing, Quality Assurance, Security +## Testing, Quality Assurance, Security Proposals related to best practices and tools to test code, infrastructure and the whole environment. How do we make sure that new (and old) code do what they are supposed to do and that there are no (un-)intentional accidents that destroy or expose data. [//]: # (### Packages and Modules Maintenance) [//]: # (Proposals related to ) -### Community Building, Education, Outreach +## Community Building, Education, Outreach Proposals related to people, working together and learning. -### Ethics, Social Responsibility, Sustainability, Legal +## Ethics, Social Responsibility, Sustainability, Legal Proposals related to the social science around Python. This category includes discussion of lines that should not be crossed, either because of formal laws or the values of our community. It also includes proposals to help make sure that people will be able to write and maintain Python code in the future, and feel good about doing that. -### Professional Development, Careers, Leadership +## Professional Development, Careers, Leadership From junior to senior, from the lone wolf to the leader of multiple people. What are the options? Why is the goal not the same for everyone? And why should we keep this in mind if we are trying to lead teams? -### Python for Games, Art, Play and Expression +## Python for Games, Art, Play and Expression Proposals related to the playful applications of Python. This category includes proposals that use Python in ways that bring joy to you and others. -### Machine Learning: Research & Applications +## Machine Learning: Research & Applications Proposals related to cutting edge innovations in machine learning and related fields (natural language processing, computer vision, etc.). -### Machine Learning, NLP and CV +## Machine Learning, NLP and CV Proposals related to the use of Python for machine learning (ML), natural language processing (NLP) and computer vision (CV). This category includes proposals on how to work with Python packages for ML, NLP and CV, such as scikit-learn, TensorFlow, PyTorch, OpenCV, Transformers or LangChain. It also includes proposals which demonstrate ML, NLP or CV projects using Python. -### Data Preparation and Visualisation +## Data Preparation and Visualisation Proposals related to the use of Python for data preparation and visualisation. This category includes proposals on how to work with Python packages for cleaning and transforming datasets (e.g., Pandas) and those for creating static and dynamic data visualisations. -### Jupyter and Scientific Python +## Jupyter and Scientific Python Proposals related to the development of Python packages for scientific work, including Jupyter notebooks. This might include packages for scientific, mathematical or data science and machine learning work. This category can also include proposals on how to work with scientific Python packages that don’t fit into any of the other PyData categories, such as the use of NumPy or SciPy. -### Data Engineering and MLOps +## Data Engineering and MLOps Proposals related to working with big data in Python, as well as those related to deploying machine learning models. This category includes proposals discussing Python packages for working with big data, including distributed computing frameworks such as PySpark and packages for working with databases. It also includes proposals discussing the use of Python for machine learning experiment tracking, model deployment and model monitoring. -### Other Topics +## Other Topics Proposals that don’t fit into any other categories. diff --git a/src/content/pages/sponsorship/sponsor.mdx b/src/content/pages/sponsorship/sponsor.mdx index ef60f6a03..d4f37d20a 100644 --- a/src/content/pages/sponsorship/sponsor.mdx +++ b/src/content/pages/sponsorship/sponsor.mdx @@ -4,6 +4,7 @@ subtitle: Sponsoring EuroPython guarantees you highly targeted visibility and the opportunity to present yourself and your company to one of the largest and most diverse Python communities in Europe and beyond. +toc: false --- # Why Sponsor EuroPython? diff --git a/src/content/pages/terms.mdx b/src/content/pages/terms.mdx index ef9b8a521..4bea3919b 100644 --- a/src/content/pages/terms.mdx +++ b/src/content/pages/terms.mdx @@ -1,7 +1,6 @@ --- title: Terms and Conditions subtitle: These terms and conditions apply to all attendees, sponsors and other participants in the EuroPython 2025 conference. -toc: true --- # Terms & Conditions diff --git a/src/content/pages/tickets.mdx b/src/content/pages/tickets.mdx index 5a88936b5..7215ede30 100644 --- a/src/content/pages/tickets.mdx +++ b/src/content/pages/tickets.mdx @@ -2,6 +2,7 @@ title: Tickets subtitle: Discover the latest Python trends, learn from 180+ expert speakers, network with fellow developers, enjoy social events, and explore open spaces to spark new ideas! Organized by the community for the community. +toc: false --- import TicketTiers from "../../components/ticket-tiers/ticket-tiers.astro"; diff --git a/src/content/pages/venue.mdx b/src/content/pages/venue.mdx index 9aac6448e..f0d2e8efd 100644 --- a/src/content/pages/venue.mdx +++ b/src/content/pages/venue.mdx @@ -1,7 +1,6 @@ --- title: Venue subtitle: EuroPython 2025 will be back in Prague! -toc: true --- import { Image } from "astro:assets"; diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index a81734508..97f54a656 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -106,7 +106,7 @@ document.addEventListener("DOMContentLoaded", () => { const tocContainer = document.getElementById("toc"); if (!tocContainer) return; - const headings = Array.from(document.querySelectorAll("article h2, article h3, article h4")); + const headings = Array.from(document.querySelectorAll("article h2, article h3, article h4, article summary span:nth-child(1)")); if (!headings.length) return; const rootUl = document.createElement("ul"); @@ -139,6 +139,15 @@ document.addEventListener("DOMContentLoaded", () => { lastLevel = level; }); + // Add "Back to top" link + const backToTop = document.createElement("li"); + const topLink = document.createElement("a"); + topLink.href = "#"; + topLink.textContent = "↑ Back to top"; + topLink.style.marginTop = "1em"; + backToTop.appendChild(topLink); + rootUl.appendChild(backToTop); + tocContainer.appendChild(rootUl); // Scroll spy: highlight active link @@ -156,7 +165,7 @@ document.addEventListener("DOMContentLoaded", () => { }); }, { - rootMargin: "-30% 0px -60% 0px", // adjust when to highlight + rootMargin: "-30% 0px -60% 0px", threshold: 0, } ); @@ -170,7 +179,6 @@ document.addEventListener("DOMContentLoaded", () => { #toc { font-size: 0.95rem; line-height: 1.5; - max-width: 300px; padding: 1rem; border-left: 1px solid #e0e0e0; position: sticky; @@ -198,7 +206,7 @@ document.addEventListener("DOMContentLoaded", () => { color: #333; display: block; padding: 0.25em 0.5em; - border-radius: 4px; + /*border-radius: 4px;*/ transition: background 0.2s ease, color 0.2s ease; } @@ -214,4 +222,15 @@ document.addEventListener("DOMContentLoaded", () => { background: rgba(0, 122, 204, 0.1); padding-left: 0.5em; } + +#toc a[href="#"] { + font-size: 0.9em; + color: #555; + margin-top: 0.5em; +} + +#toc a[href="#"]:hover { + color: #007acc; + text-decoration: underline; +} diff --git a/src/styles/global.css b/src/styles/global.css index c2d5e81ac..2f4e89d97 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -253,7 +253,10 @@ h2 { scroll-margin-top: 40px; } -main a[href^="#"]:not([data-footnote-backref]):not([data-footnote-ref])::after { +main + a[href^="#"]:not([data-footnote-backref]):not([data-footnote-ref]):not( + #toc a + )::after { content: " ⤵"; font-size: 0.9em; opacity: 0.2; From 143764519acb2e44d13aa8c1f588ee1c8eca259f Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 13:21:10 +0200 Subject: [PATCH 4/8] Update content. --- src/content/pages/contacts.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/pages/contacts.mdx b/src/content/pages/contacts.mdx index 20d0a53b3..3b29f9a76 100644 --- a/src/content/pages/contacts.mdx +++ b/src/content/pages/contacts.mdx @@ -5,14 +5,14 @@ subtitle: Read how you can contact the EuroPython Organisation # Contacts -### EuroPython Helpdesk +## EuroPython Helpdesk We are here to help! If you have any questions or spot any problems, reach out to us: - [helpdesk@europython.eu](mailto:helpdesk@europython.eu) -### EuroPython Socials +## EuroPython Socials Subscribe to our newsletter to receive the main EuroPython conference news: @@ -32,32 +32,32 @@ Follow us on these channels: Please use the hashtag #EuroPython when referring to the conference. -### Code of Conduct Report +## Code of Conduct Report Please see the [Code of Conduct page](https://www.europython-society.org/coc/) for CoC contact information. -### EuroPython Website Issues +## EuroPython Website Issues For problems with the website, we have a fancy option: report them using the [GitHub issue tracker](https://github.com/EuroPython/website/issues) for our website. -### EuroPython Privacy Inquiries +## EuroPython Privacy Inquiries For [EuroPython privacy](https://www.europython-society.org/privacy/) related questions and requests, contact us at: - [privacy@europython.eu](mailto:privacy@europython.eu) -### EuroPython Sponsor Contact +## EuroPython Sponsor Contact If you are interested in sponsoring EuroPython, please contact the sponsoring team: - [sponsoring@europython.eu](mailto:sponsoring@europython.eu) -### EuroPython Society +## EuroPython Society The EuroPython Society (EPS) can be reached via one of the following addresses: From 76bfeb5b8e72e8ff300f8c54338dc59d1237f42a Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 15:07:15 +0200 Subject: [PATCH 5/8] Update styles and behavior. --- src/pages/[...slug].astro | 369 ++++++++++++++++++++------------------ 1 file changed, 195 insertions(+), 174 deletions(-) diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index 97f54a656..a00d8a4e5 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -51,186 +51,207 @@ const description = post.data.subtitle; --- - - { post.data.toc ? - - - -
    -
    - - - - - -
    - : - - - - } + { + post.data.toc ? ( + + +
    + Table of contents +
    +
    + + + + + +
    + ) : ( + + + + ) + }
    From 1f2adeff4ac416fd1fc31001120f92a96316c143 Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 16:04:23 +0200 Subject: [PATCH 6/8] Tickets with toc magic. --- .../ticket-tiers/ticket-tiers.astro | 31 +++++++++++++------ src/content/pages/tickets.mdx | 1 - 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/ticket-tiers/ticket-tiers.astro b/src/components/ticket-tiers/ticket-tiers.astro index 5f18f7607..820319d81 100644 --- a/src/components/ticket-tiers/ticket-tiers.astro +++ b/src/components/ticket-tiers/ticket-tiers.astro @@ -134,7 +134,7 @@ const formatPrice = (price: number | string) => { ---
    -
    +
    { tiers.map((tier) => (
    @@ -203,19 +203,30 @@ const formatPrice = (price: number | string) => { diff --git a/src/content/pages/tickets.mdx b/src/content/pages/tickets.mdx index 7215ede30..5a88936b5 100644 --- a/src/content/pages/tickets.mdx +++ b/src/content/pages/tickets.mdx @@ -2,7 +2,6 @@ title: Tickets subtitle: Discover the latest Python trends, learn from 180+ expert speakers, network with fellow developers, enjoy social events, and explore open spaces to spark new ideas! Organized by the community for the community. -toc: false --- import TicketTiers from "../../components/ticket-tiers/ticket-tiers.astro"; From 683dfb417af29f04a0146f3271920d4bb09ba0d5 Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 16:48:24 +0200 Subject: [PATCH 7/8] Clean up. --- src/content/pages/sponsorship/sponsor.mdx | 1 - src/layouts/MarkdownLayout.astro | 195 ++++++++++++++++--- src/pages/[...slug].astro | 225 ++-------------------- 3 files changed, 188 insertions(+), 233 deletions(-) diff --git a/src/content/pages/sponsorship/sponsor.mdx b/src/content/pages/sponsorship/sponsor.mdx index d4f37d20a..ef60f6a03 100644 --- a/src/content/pages/sponsorship/sponsor.mdx +++ b/src/content/pages/sponsorship/sponsor.mdx @@ -4,7 +4,6 @@ subtitle: Sponsoring EuroPython guarantees you highly targeted visibility and the opportunity to present yourself and your company to one of the largest and most diverse Python communities in Europe and beyond. -toc: false --- # Why Sponsor EuroPython? diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index 4842284a5..2ec404fdd 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -3,40 +3,183 @@ import Layout from "@layouts/Layout.astro"; import Section from "@ui/Section.astro"; import Prose from "@components/prose/prose.astro"; import TwoCols from "@components/TwoCols.astro"; -import { marked } from 'marked'; import "../styles/markdown.css"; const { title, description, toc=false } = Astro.props; -import remarkToc from 'remark-toc' - -//const html0 = marked.parse(Astro.slots.render); -const html = await Astro.slots.render('default'); - - //html.use(remarkToc) - //.process(await read('src/content/pages/childcare.mdx')) - ---
    - { toc ? - - - - - - - -
    - - - : - - - - } - + { + toc ? ( + + +
    + Table of contents +
    +
    + + + +
    + ) : ( + + ) + }
    + + + + diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index a00d8a4e5..8c67d1155 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -1,6 +1,6 @@ --- import { type CollectionEntry, getCollection } from "astro:content"; -import Layout from "@layouts/SectionLayout.astro"; +import Layout from "@layouts/MarkdownLayout.astro"; import ButtonLink from "../components/button-link/button-link.astro"; import { Separator } from "../components/separator/separator"; @@ -15,9 +15,7 @@ import { Note } from "../components/note"; import SponsorTiers from "../components/sponsor-tiers/sponsor-tiers.astro"; import Accordion from "../components/accordion/accordion.astro"; -import TwoCols from "@components/TwoCols.astro"; import Prose from "@components/prose/prose.astro"; -import Headline from "@components/ui/Headline.astro"; export async function getStaticPaths() { const pages = await getCollection("pages"); @@ -51,207 +49,22 @@ const description = post.data.subtitle; --- - { - post.data.toc ? ( - - -
    - Table of contents -
    -
    - - - - - -
    - ) : ( - - - - ) - } + + +
    - - - - From a3433bc4cfcf4ae7aee1f8e07af19f251a42e9c4 Mon Sep 17 00:00:00 2001 From: Niko Date: Sat, 10 May 2025 16:51:32 +0200 Subject: [PATCH 8/8] Sponsors packages stays with narrow layout. --- src/content/pages/sponsorship/sponsor.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/pages/sponsorship/sponsor.mdx b/src/content/pages/sponsorship/sponsor.mdx index ef60f6a03..d4f37d20a 100644 --- a/src/content/pages/sponsorship/sponsor.mdx +++ b/src/content/pages/sponsorship/sponsor.mdx @@ -4,6 +4,7 @@ subtitle: Sponsoring EuroPython guarantees you highly targeted visibility and the opportunity to present yourself and your company to one of the largest and most diverse Python communities in Europe and beyond. +toc: false --- # Why Sponsor EuroPython?