Adding a CMS to Your Flask Web App Transcripts
Chapter: Advanced markdown
Lecture: Using shared content, first pass

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Well, the speed was pretty awesome. But honestly, it's not super hard for us to at that ourselves to cash the
0:06 markdown content from that role method that we wrote. If we want a real simple cash,
0:11 but we can do more and let's start taking advantage of another component. Remember, I showed you the reusable elements from talk Python training.
0:19 Where on the course landing pages, you've got things like this one has transcripts, and here's a little blurb and image about what transcripts mean.
0:26 And we're reason reusing that across 25 different landing pages, maybe more. We edit it in one place. It's edited everywhere. It's a thing of beauty,
0:34 so we're gonna add that capability here or it's already here. Actually, we're just gonna take advantage of it now.
0:40 The first thing to Dio we're gonna have to have something in the database to share So let's go at a new page and this is a B suggest fix and
0:49 let's just go over here and say it's to be suggest fixed like that. Okay, so we're gonna need to use that when we talk about sharing it,
0:58 and then down here, we'll just have some simple content. Let's have ah H four see a problem with this page to use a simple message please shoot us. Ah,
1:08 message on Twitter. Just say there's a problem with this page and let's actually make this a URL So we could go over and sit control.
1:16 Come in K and the HBs Twitter com slash of the psf preview it Make sure it works Just a little link. Yeah, that looks like that's the PSF.
1:30 Here's one thing that we're going to address. We're not there yet. We'll get to in a minute.
1:34 These pieces here are the pages of our website that are important to us. They make up our website. This is like a reusable thing that we could reuse
1:44 somewhere. I would like to separate these two in this list.
1:47 I would like to indicate here shared stuff that you shouldn't be requesting directly and hear stuff that is meant to be the top level.
1:54 Okay, But for now, we don't have that in that distinction in our database And so we gotta go with this and we'll get it soon.
2:01 So let's go over here and let's say go to the Donate one. I'm gonna add this now with the market on sub template.
2:08 All you gotta do to add that element in there's we've got to say all caps import and then just the your else of suggest fix.
2:15 Now it could be suggest slash fix. If you wanted to be like that, it doesn't really matter, Right? But so whatever we want the world to be,
2:22 we put that there. We could even have more stuff here. Okay, well, let's edit or save. Go back and you are doing it and see what we got.
2:34 How sweet is that? No, I only put it in one place. So it's not super impressive because, well, it's only on this page. We could have typed it right in.
2:44 But remember the ideas toe, reuse it. So let's put it some other places. Let's go over here. We're gonna take this and we're just gonna put it in
2:52 a few other places. Goto our company history. Say if you see a problem there, please let us know. Let's go to our team. If you see a problem there,
3:02 let us know now if we dio in view all three of these as you flip through them. Notice exactly the same content.
3:13 Is that cool or what? Even it could be in the middle of these can Chain up. You're gonna multiple imports. Imports can have imports itself. Right?
3:20 This sort of the whole tree of dependencies you can build up and really, it's it's quite nice. So here we are,
3:28 with a much more advanced system that lets us have these really cool ways to bring
3:33 in potentially large, nested, reused elements of markdown toe build up our page. So if we've got stuff we were using a lot,
3:42 then this will make a building and maintaining our site much easier.


Talk Python's Mastodon Michael Kennedy's Mastodon