Attach to Process

WriteAs

There was a bug on my Write.as Archive Page Generator web app. Instead of creating URLs with the correct alias in there, for instance https://write.as/dino/blog-post-title, it was hard-coding the word alias, like https://write.as/alias/blog-post-title.

It was an easy fix, though it wasn't the web app that was broken, but the API that it was calling. I mentioned in a previous post, that I was working on an API to power my Blazor WASM apps. The API is functional, it's out there on the internet, running as an Azure App Service. And it's the one with the bug that I just fixed a few hours ago.

So, the Write.as Archive Page Generator should be working correctly now. You no longer need to do a “search and replace” on the output to correct the URLs.

Tags: #Blazor #WriteAs

Discuss... or leave a comment below.

My Write.as Archive Page Generator is back up and running. I've already updated the Archive pages for my other blogs. It seems to be working fine. Please give it a try and let me know if you run into any issues with it.

I did notice, during my testing, that it can fail on blogs with a huge number of posts. That's mainly because the API call times out at like the 1.7 minute mark. I'll see if I can fix that in the future. But for now, just getting the archive page generator working is a win. So I'll call it a day.

Tags: #Blazor #WriteAs

Discuss... or leave a comment below.

Version 1.2.1 of WriteAs.Net has been released.

This very minor update adds an interface for the WriteAsClient class, which opens it up for use with dependency injection in ASP.NET Core. This allows you to create a single WriteAsClient instance and re-use it when needed, making the caching additions from Version 1.2.0 much more useful.

This also frees me up to make better use of it in the API I'm working on.

You can install it via nuget: Install-Package WriteAs.NET -Version 1.2.1

Or via the .NET Core command line interface: dotnet add package WriteAs.NET --version 1.2.1

If you find any bugs or issues with it, please let me know. Thanks and y'all have a good night.

Tags: #DotNet #WriteAs #WriteAsNet

Discuss... or leave a comment below.

A number of people have been asking me about why the WriteAs Archive Page generators I made no longer work. They no longer work because of CORS restrictions on the API server. I'm trying to see if I can work around the restrictions on my Blazor WASM apps by going the Web API route.

Started working on an API for my websites

Tags: #DevLog#ASPNETCore #WebAPI #WriteAs

Discuss... or leave a comment below.

It's been awhile since I updated the contents of the Archive page on my journal. I stopped updating when my Blazor apps stopped working. Archive Page - Dino's Journal - 20220625

I remember working on some update to my Blazor apps, but the limitation of Blazor WASM as a client-side application, plus the CORS restrictions I kept running into, made it a headache and so I stopped. I eventually created a WPF app just for my own use.

WriteFreely Archive Page Generator written in C# and WPF

This is what I used today to generate the contents for my archive page. Yes I know it is ugly. But I just need it to work, I don't need it to look pretty. And well, it does the job just fine, so I'm happy with it.

Since it is a WPF app, it will only run in Windows. So sorry folks, it's not something that everyone else can easily use. But if there's enough interest on it, I can share the source code in a public repo. Let me know in Remark.as or in the comments below.

Tags: #WriteAs #WPF

Discuss... or leave a comment below.

Version 1.2.0 of WriteAs.Net has been released.

This latest version now allows you to enter an API key when initializing a WriteAsClient instance. This API key will allow you to bypass the rate limiting checks on the Write.as API.

Some basic in-memory caching has also been added to the client. You can configure some of the cache settings when initializing a WriteAsClient instance. The new settings are described below:

  • cacheExpirationInSeconds determines how long data will stay in the cache before it expires. The default value for this setting is 300 seconds.
  • cacheSize determines how many objects it can store in the cache. Note that a collection of posts (List<Post>) and a single post each count as 1 item. The default value for this setting is 4.

You can install it via nuget: Install-Package WriteAs.NET -Version 1.2.0

Or via the .NET Core command line interface: dotnet add package WriteAs.NET --version 1.2.0

If you find any bugs or issues with it, please let me know. Thanks and y'all have a good weekend.

Tags: #DotNet #WriteAs #WriteAsNet

Discuss... or leave a comment below.

I'm working on an update to the WriteAs.Net client/wrapper library. In a previous post I talked about adding caching to it before I release a new version. I ran into some road-blocks that derailed me. I ended up pushing it off to the side to focus my time somewhere else.

The two issues that I ran into were: figuring out what the cache key was going to be for the cached object and removing the oldest object in the cache. I now have solutions for those issues.

For the cache keys, I figured I could use the method name plus the parameter values.

For clearing out the oldest cached object, I decided to make use of a generic Queue collection that could accept the cache key values. Then I could just pop-off the oldest value from the Queue and use that to remove the associated object in the cache.

And so anyway, I should have the updated version of the client/wrapper library out soon. I just need to do some more testing on it.

Tags: #DotNet #WriteAs #WriteAsNet

Discuss... or leave a comment below.

On some of the pinned pages on my journal, I added a “Last Updated Date” value right under the title. I did it using a span element, like this:

# Archive📜

<span class="lastUpdatedDate">Last Updated: 2021-03-17</span>

Now, instead of having it show up under the title all the time, I also wanted it to show up to the right of the title, if the screen was wide enough.

So, if the page is being viewed on a wide screen, like on a desktop computer, the “Last Updated Date” will show up on the right side. If the page is being viewed on a small screen, like on a mobile phone, the “Last Updated Date” will show up under the title.

Here is how I made it responsive using Custom CSS:

span.lastUpdatedDate {
   font-size: 0.7em; 
   color: silver; 
}
@media screen and (min-width: 480px) {
   span.lastUpdatedDate {
      float: right; 
      margin-top: -4em; 
      margin-bottom: -4em;
   }
}
@media screen and (max-width: 479px) {
   span.lastUpdatedDate {
      margin-top: -2em;
      padding-bottom: 2em;
      display: block;
   }
}

Here is what it looks like on a wide screen: Last Updated Date showing up on the right side of the title.

Here is what it looks like on a mobile phone: Last Updated Date showing up under the title on a small screen.

If you know of an easier way to do this with less CSS, please let know in the comments below. Or you can do so privately by leaving me a message.

Tags: #HowTo #CSS #WriteAs

Discuss... or leave a comment below.

Due to the rate-limiting feature that the Write.as team introduced into their API, a number of my Blazor WASM apps, like the WriteFreely Archive Page Generator I created, have stopped working. All of the Write.as related Blazor WASM apps I created, use the WriteAs.Net client/wrapper library that I wrote. And it is actually this client/wrapper library that is running into the rate-limiting problem.

But, as Matt mentioned here, a solution is in place through the use of Application keys.

I've already updated the WriteAs.Net client to make use of Application keys. But before I release the latest version, I also want to give it some caching abilities. That's what I'm working on and testing right now in my spare time. Once that's done, I'll publish the latest version of the WriteAs.Net client to Nuget.

After that, I plan to get the WriteFreely Archive Page Generator working once again. Then I'll work on getting the Search app for my journal working as well.

Tags: #Blazor #WriteAs #WriteAsNet

Discuss... or leave a comment below.

There are two ways that I know of to customize the footer on a Write.as website. The first one is through CSS and the second one is through JavaScript. I'll go through those two options in this post.

Option 1: CSS

I got this idea of customizing the footer via CSS after looking at Robert Xu's Write.as powered site. It puzzled me that I could not highlight the text in the footer. After viewing the page source, I finally figured out that it was CSS trickery.

So, anyway here we are. To customize the footer using CSS, all you need to do is modify the following CSS script, then add it to the Custom CSS settings for your website.

footer nav::before {
    content: "Copyright © 2020 - 2021 by Your Name \A";
    white-space: pre-wrap;
}
Read more...