Archive

Archive for April, 2020

Learn Eleventy From Scratch

April 7th, 2020 No comments

The latest edition of Andy Bell’s Piccalilli landed in my inbox this morning with a sweet offer: preorder Andy’s course on learning Eleventy from scratch at a third of the price.

Why the plug? No, not sponsorships or anything like that. I just happen to hear a heckuva lot about Eleventy these days. Like how we can use it with Google Sheets as a pseudo-CMS. Or how it can be a key component of an emergency website kit. I mean, geez, Chris even used it for the conferences site we have around here. As Andy says, “the future is bright because the future is static.” At least, it certainly appears that way.

I’m squarely in the novice camp when it comes to Eleventy, not to mention static site generators as a whole. That’s why I signed up for the course. It promises to be a deep dive that starts with an empty directory and goes all the way to full-blown website. Given that Andy has created more Eleventy sites than most folks (seriously, it’s documented) and that his Eleventy-powered Piccalilli site notches perfect Lighthouse scores, I think he’ll have a lot to offer in a course.

While we’re on the topic of Eleventy, there are other guides, tutorials and courses out there you might find compelling:

Direct Link to ArticlePermalink

The post Learn Eleventy From Scratch appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

Top 10+ Team Showcase WordPress Plugins

April 7th, 2020 No comments

If you want to showcase your employees or team members on your website, then, you are in the right place.

All the below mentioned plugins are well suitable and help to present your team or employees in various styles with amazing layouts.

Representing your employees or team members on the website who work hard for your products or services will help to build a strong trust level for your customers. It definitely brings credibility to your organization. Though, it is not just a workplace or organization where you need to showcase team members. You can also use these plugins if you are running sports clubs, fitness websites, and many more.

Especially for you, I’ve clubbed a useful list of team members showcase plugins that will help you to create an attractive team display layout for your WordPress website. All the mentioned plugins have distinct features and functionality.

Pick wisely & create an astonishing layout.

Explore Now:

The Team Pro

The Team Pro is an awesome and versatile WordPress plugin for creating a team showcase on your website. This plugin comes with 5+ cool presets and various style options. It is also enabled with the WordPress Bakery page builder. Moreover, this plugin has the support of the new version of WordPress, and it is Gutenberg. You can demonstrate your all team member’s details differently with its amazing layouts. Apart from this, You can also create more than one teams and as well as assign team members to different teams. It is one of the best plugins that provides astounding designs.

Download Now: https://codecanyon.net/item/the-team-pro-team-showcase-wordpress-plugin/17521235

Portfolio Designer

Portfolio Designer is a multipurpose WordPress plugin. It is an ideal plugin to create an attractive portfolio, grid, galleries, and showcase team members or logos with a fancy design. It is a solid fit for displaying your team or staff members as well. This plugin is also tested for cross-browser compatibility. Moreover, the templates are responsive to all devices.

Portfolio Designer WordPress plugin has multiple popup box features too. This plugin provides 4 most popular layout styles which are grid, masonry, slider or justify. More than 50+ predefined effects and animation provide a magnificent look to your layout.

It is user-friendly, and most favorite plugin from that, It provides all the functionality in the one tool.

Download Now: https://codecanyon.net/item/portfolio-designer-for-wordpress/22065710

Team Showcase

As the name suggests, this plugin helps to create a showcase for your team members. Team Showcase is the most popular plugin in the CodeCanyon marketplace. This plugin has a pre-built layout available, using that you can easily create the best team showcase, or you can easily customize it as per your website demand. You can showcase the members in the grid-like grid layout with information, table, and thumbnail pager layout. This plugin also helps you to categorize the team members and applies the filter option to search or view specific members. It is easy to use and a widget ready plugin.

Download Now: https://codecanyon.net/item/team-showcase-wordpress-plugin/4936368

Creative Team Showcase

Creative Team Showcase is another powerful WordPress plugin that lets you introduce your team creatively. This plugin has inbuilt 5+ layouts with multiple options. It is fully customizable, and now you can control everything you want and make your showcase attractive. It is compatible with the WordPress Bakery page builder as well as supports drag & drop functionality. You can also add an unlimited number of skills for each member and include their social profile link as well. An excellent option for a professional website!

Download Now: https://codecanyon.net/item/creative-team-showcase/22096199

TeamPress

TeamPress is another wonderful plugin that helps you create information about your staff or team members with an attractive layout. It includes 60+ layout quality and essential features that allow you to create an elegant showcase. This plugin has Ajax alphabetical filter, Ajax search, ajax category filter, and ajax pagination. These features make a user-friendly portfolio. You can also create unlimited team groups. It offers a variety of different styles, so there is no single look. A great and amazing plugin!

Download Now: https://codecanyon.net/item/teampress-team-showcase-plugin/22952433

Modern Team Showcase

Modern Team Showcase is a perfectly optimized WordPress plugin. It is a great solution to quickly create the best grid layouts for showcasing your valuable team members. This plugin has 10+ responsive presets that ensures you to quickly start with your choice of preset. It also has a frontend showcase editor & password forms. Its real purpose is to help you enormously to improve the quality of your output given the time you have for your project. It is the best plugin to meet all your needs.

Download Now: https://codecanyon.net/item/modern-team-showcase-wordpress-plugin/12173695

DV Team Responsive Team Showcase

DV Team is a premium and highly customizable WordPress plugin. It is featured-packed and optimized for all devices. You can use this versatile plugin that helps to customize it whatever you want. It is an absolute best plugin for displaying a team or group of individuals. This plugin has 5 different grid-style layouts and 6 custom type post formats. It is compatible with the SiteOrigin Page Builder plugin. Try it now!

Download Now: https://codecanyon.net/item/dv-team-responsive-team-showcase-wordpress-plugin/9962337

Club Portfolio

Club Portfolio is an astonishing grid plugin that helps to create a powerful portfolio. It is not only perfect for creating a portfolio but an image gallery, team members, blog posts, or any other ordered grid content. It has a live template builder, so using that you can control every aspect of the plugin. This plugin accustoms the layout to the viewing devices by using a fluid grid. It offers a consistent user experience. This plugin has 5+ starter templates that you can opt for the best one for you. It comes with versatile team member showcase layouts. A great plugin!

Download Now: https://codecanyon.net/item/cube-portfolio-responsive-wordpress-grid-plugin/8534570

My Team Showcase

My Team Showcase is another useful and latest WordPress plugin that helps to create unlimited team members. This plugin also builds an attractive and responsive grid or slider for elegantly showcasing your team list. It comes with special 15 themes, 10 color schemes, and 10 display options. It has many features like widget time ready, slideshow options, team management and many more. My Team showcase is the most complete plugin in the market. Try the advance plugin!

Download Now: https://codecanyon.net/item/my-team-showcase-wordpress-plugin/7371735

Heroes Assemble

Finally, Heroes Assemble WordPress plugin helps to create an attractive team showcasing layouts. This plugin comes with 10 unique styles and 12 color skins that give an elegant look. You can easily create staff, team members, or any other type of group on your WordPress website. You can also include a brief description of your team members with social sharing icons. It also comes with a PO file that you can use to translate the plugin to any language.

The most flexible plugin!

Download Now: https://codecanyon.net/item/heroes-assemble-team-showcase-wordpress-plugin/11469747

Final Thought!

All an all, you can easily get knowledge about these plugins by carefully reading this given blog. These plugins help you to display your teams or employees in the distinct styles with eye-catching layouts on the website. We hope these plugins suit your project well.

Please drop a comment, or let us know if we forget to mention any essential plugin!

Creator: Mark Henry

Website: https://singlewebdesign.wordpress.com/
Follow him on Twitter & Facebook

Categories: Others Tags:

How to Re-Create a Nifty Netflix Animation in CSS

April 7th, 2020 No comments

The design for Netflix’s browse page has remained pretty similar for a few years now. One mainstay component is the preview slider that allows users to scroll through content and hover on items to see a preview.

One unique characteristic of the UI is its hover behavior. When a show preview expands on hover, the cards next to it are pushed outward so that they don’t overlap.

Like this:

It’s like Bill Murray and Brad Pitt are fighting for the spotlight.

We can do this in CSS! No JavaScript. No dependencies. Plain CSS. But before getting into any code, here’s exactly what we want to do:

  1. The card that is hovered over should expand while keeping its aspect ratio.
  2. When a card is hovered, the other cards should not change size and move outwards so that they don’t overlap one another.
  3. All the cards should remain vertically centered with one another.

Sound good? Now let’s get into the code.

HTML and flexible elements

Let’s set up a row of images that represents Netflix’s video previews. That includes:

  • A .container parent element with several .item elements inside
  • Each .item element consisting of an image wrapped in an anchor tag
  • Turning .container into a flex container that aligns the items in a row
  • Setting the flex behavior for the .item class so they take up equal space in the row
CodePen Embed Fallback

Expanding an item on hover

Our next step is getting an item to expand when it is hovered. We could do this by animating the element’s width, but that would affect the flow of the document and cause the hovered item’s siblings to shrink – plus, animating the width property is known to be poor for performance in some cases.

To avoid squeezing the sibling of the hovered item, we are going to animate the transform property — specifically, its scale() function — instead. This won’t affect document flow the same way width does.

CodePen Embed Fallback

Moving siblings outward

Getting the siblings of a hovered item to move away from the hovered item is the tricky part of this whole thing. One CSS feature we have at our disposal is the general sibling combinator. This lets us select all of the sibling items that are positioned after the hovered item.

We’ll turn to the transform property’s translateX() function to move things around. Again, animating transform is much nicer than other properties that impact document flow, like margins and padding.

Since we’ve set an item to scale up 150% on hover, the translation should be set to 25%. That’s half of the additional space that is being occupied by the hovered item.

.item:hover ~ .item {
  transform: translateX(25%);
}

That handles moving things to the right, but how can we translate the items on the left? Since the general sibling combinator only applies to siblings positioned after a given selector (no going “backwards”), we’ll need another approach.

One way is to add an additional hover rule on the parent container itself. Here is the plan:

  • When hovering the parent container, shift all the items inside that container to the left.
  • Use the general sibling combinator to make the items positioned after the hovered item move to the right.
  • Get super specific so a hovered item isn’t translated like the rest of the items.

We’re making a big assumption that your document uses a left-to-right writing mode. If you want to use this effect in a right-to-left context, you will need to set all items inside the hovered outer container to move right and use the general sibling combinator to move all selected items left.

Demo time!

CodePen Embed Fallback

One little thing to note: this final version is using :focus and :focus-within pseudo-classes to support keyboard navigation. The Netflix example isn’t using it, but I think that’s a nice touch for accessibility.


There we have it! Yes, we could have used JavaScript event listeners instead of CSS hover rules., and that could possibly be better for maintainability and readability. But it’s sometimes fun to see just how far CSS can take us!

The post How to Re-Create a Nifty Netflix Animation in CSS appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

CSS Findings From The New Facebook Design

April 7th, 2020 No comments

Ahmad Shadeed digs around the new Facebook’s front-end code.

One that stood out to me:

.element {
  inset: 4px 0;
  /* Which is equivalent to: top: 4px, bottom: 4px, left: 0, right: 0 */
}

Whaaat? This is the first I’ve heard of the inset property. Ahmad said he saw it working in Chrome 80, but it definitely isn’t for me (nor Safari). It does in Firefox though.

Chrome 80 and Firefox 75

It’s shorthand for top/left/bottom/right, which is certainly welcome if you ask me. Bring on the support.


If you’re into people digging into big sites to learn stuff…

Direct Link to ArticlePermalink

The post CSS Findings From The New Facebook Design appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

10 best recession-proof business ideas

April 7th, 2020 No comments
10 best recession-proof business ideas

Recessions are nothing new in the U.S. We’ve experienced three over the last three decades. And on Friday, the International Monetary Fund (IMF) declared that the global economy had just entered a new recession as a result of the spread of the coronavirus.

This economic downturn might be the toughest we’ve undergone yet. But while millions are applying for unemployment, there’s also a ray of hope because certain businesses are actually hiring right now. That’s especially true of the businesses that provide what are now known as “essential services.”

Those that are hiring can be classified as “recession-proof businesses.” Of course, no business is completely immune to a recession. However, the success of these businesses, even during hard economic times, can give you some ideas you may want to consider for your career or startup.

Here are 10 of the best recession-proof business ideas:

  1. Delivery

  2. No longer viewed as a luxury or added convenience, home delivery is increasingly in demand. Companies like DoorDash, Instacart, Shipt, and others are doing extraordinarily well primarily because, during this recession, people must stay home in order to flatten the coronavirus infection curve.

    This dependence on deliveries for home-based workers and others could become the norm even after the current shelter-in-place mandates are lifted, and without another outbreak in the near future.

  3. Repair or maintenance services

  4. Even while we’re sheltering in place, people still need their vehicles, appliances, and computers to be serviced and kept in good working order.

    When these things break, they need to be repaired. After all, we depend on our work devices to continue making money and our kitchen appliances for food storage and preparation, and so on. Even when money is tight, people will find a way to get these items repaired.

  5. Essential services

  6. Our federal and state governments mandate that certain important services remain operational and/or available, even during shelter-in-place orders. These essential services include utilities, public works, grocery retailers, and food manufacturers. Other services, such as education, have moved online. If you can provide products and services in any of these areas, you’ll be able to ride out the recession.

    For example, if you create educational content or educational apps, your services may be in high demand. And if your technology solution can cost-effectively manage utilities, then you may also be able to carve out ongoing work.

  7. Healthcare

  8. Healthcare is an essential service that’s especially critical during this pandemic-caused recession. The healthcare industry offers many opportunities to continue working, no matter what type of recession hits. After all, everyone needs to maintain their health, and those with underlying conditions must receive critical care.

    Consequently, physicians, ambulatory care services, nurses, and specialized care providers will remain recession-proof. Home healthcare providers and veterinary services also fit this category.

    As the current pandemic shows, many companies are pivoting to provide much-needed equipment like respirators. And future recessions may create a demand for other medical devices or services.

  9. Accounting and financial services

  10. Businesses and individuals still need to complete their taxes and make financial decisions. While some will continue to tackle these tasks themselves, others will look for expert advice to help save money or reduce their tax burden. That means accountants, tax professionals, and financial advisors will continue to do well.

  11. Baby products and services

  12. Parents will continue to have babies, and they will need supplies and services that help provide necessary care. That means baby formula and food, diapers, bathing and care products, and even toys. Daycare is also critical because parents who are fortunate to have a job during a recession need to work.

  13. Cleaning services

  14. While some may give up their home cleaning service and do it themselves, other cleaning services continue to be vital. Even in a recession, a business or other commercial facility must ensure clean and sanitary conditions to maintain a safe and hygienic environment. This includes hotels, schools, and other places where many people congregate.

    The coronavirus has only increased the need for cleaning services.

  15. Property management

  16. Often, recessions can increase the number of people looking for a rental because they may no longer be able to afford their mortgages. And rental properties like apartments, condos, and houses need someone to serve as an intermediary between the property owners and the tenants, collect rent, and maintain the properties.

  17. Death and funeral provisions

  18. Although it’s not something anyone wants to think about, the reality is that death is inevitable through all economic cycles. That means funeral homes, mortuaries, and cemeteries are essentially recession-proof.

  19. Security services

  20. Recessions often make people feel increasingly desperate and can lead to increased criminal activity. Businesses need to protect their assets, so security guards and security equipment become more important in these economic cycles.

Things to consider

When preparing for any recession, consider why certain products and services are considered necessities versus luxuries. You also need to think about your typical customers and how they make purchasing decisions.

Focus on the areas that remain critical, even during hard economic times, and your business will sustain itself through all economic conditions.

Categories: Others Tags:

Smashing Podcast Episode 13 With Laura Kalbag: What Is Online Privacy?

April 7th, 2020 No comments
Laura Kalbag

Smashing Podcast Episode 13 With Laura Kalbag: What Is Online Privacy?

Smashing Podcast Episode 13 With Laura Kalbag: What Is Online Privacy?

Drew McLellan

2020-04-07T07:00:00+00:002020-04-07T09:06:51+00:00

In this episode of the Smashing Podcast, we’re talking about online privacy. What should web developers be doing to make sure the privacy of our users is maintained? I spoke to Laura Kalbag to find out.

Show Notes

Weekly Update

Transcript

Drew McLellan: She’s a designer from the UK, but now based in Ireland, she’s co-founder of the Small Technology Foundation. You’ll often find her talking about rights-respecting design, accessibility and inclusivity, privacy, and web design and development, both on her personal website and with publications such as Smashing magazine. She’s the author of the book Accessibility for Everyone from A Book Apart. And with the Small Technology Foundation, she’s part of the team behind Better Blocker, a tracking blocker tool for Safari on iOS and Mac. So we know she’s an expert in inclusive design and online privacy, but did you know she took Paris Fashion Week by storm wearing a kilt made out of spaghetti. My Smashing friends, please welcome Laura Kalbag.

Laura Kalbag: Hello.

Drew: Hello Laura, how are you?

Laura: I am smashing.

Drew: I wanted to talk to you today about the topic of online privacy and the challenges around being an active participant online without seeding too much of your privacy and personal data to companies who may or may not be trustworthy. This is an area that you think about a lot, isn’t it?

Laura: Yeah. And I don’t just think about the role of us as consumers in that, but also as people who work on the web, our role in actually doing it and how much we’re actually making that a problem for the rest of society as well.

Drew: As a web developer growing up in the ‘90s as I did, for me maintaining an active presence online involved basically building and updating my own website. Essentially, it was distributed technology but it was under my control. And these days it seems like it’s more about posting on centralized commercially operated platforms such as Twitter and Facebook, the obvious ones. That’s a really big shift in how we publish stuff online. Is it a problem?

Laura: Yeah. And I think we have gone far away from those decentralized distributed ways of posting on our own websites. And the problem is that we are essentially posting everything on somebody else’s website. And not only does that mean that we’re subject to their rules, which in some cases is a good thing, you don’t necessarily want to be on a website that is full of spam, full of trolls, full of Nazi content, we don’t want to be experiencing that. But also we have no control over whether we get kicked off, whether they decide to censor us in any way. But also everything underlying on that platform. So whether that platform is knowing where we are at all times because it’s picking up on our location. Whether it is reading our private messages because if it’s not end-to-end encrypted, if we’re sending direct messages to each other, that could be accessed by the company.

Laura: Whether it’s actively, so whether people working there could actually just read your messages. Or passively, where they are just sucking up the stuff from inside your messages and using that to build profiles about you, which they can then use to target you with ads and stuff like that. Or even combine that information with other datasets and sell that on to other people as well.

Drew: It can be quite terrifying, can’t it? Have what you considered to be a private message with somebody on a platform like Facebook, using Facebook Messenger, and find the things you’ve mentioned in a conversation then used to target ads towards you. It’s not something you think you’ve shared but it is something you’ve shared with the platform.

Laura: And I have a classic example of this that happened to me a few years ago. So, I was on Facebook, and my mom had just died, and I was getting ads for funeral directors. And I thought is was really strange because none of my family had said anything on a social media platform at that point, none of my family had said anything on Facebook because we’d agreed that no one wants to find out that kind of thing about a friend or family member via Facebook so we’d not say about it. And then, so I asked my siblings, “Have any of you said anything on Facebook that might cause this strange?” Because I just usually just get ads for make-up, and dresses, and pregnancy tests, and all those fun things they like to target women of a certain age. And my sister got back to me, she said, “Well, yeah, my friend lives in Australia so I sent her a message on Messenger, Facebook Messenger, and told her that our mom had died.”

Laura: And of course Facebook knew that we’re sisters, it has that relationship connection that you can choose to add on there, it could probably guess we were sisters anyway by the locations we’ve been together, the fact that we share a surname. And decided that’s an appropriate ad to put in her feed.

Drew: It’s sobering, isn’t it? To think that technology is making these decisions for us that actually affects people, potentially in this example, in quite a sensitive or vulnerable time.

Laura: Yeah. We say it’s creepy, but a lot of the time people say it’s almost like the microphone on my phone or my laptop was listening to me because I was just having this conversation about this particular product and suddenly it’s appearing in my feed everywhere. And I think what’s actually scary is the fact that most of them don’t have access to your microphone, but it’s the fact that your other behaviors, your search, the fact that it knows who you’re talking to because of your proximity to each other and your location on your devices. It can connect all of those things that we might not connect ourselves together in order to say, maybe they’ll be interested in this product because they’ll probably think you’re talking about it already.

Drew: And of course, it’s not as simple as just rolling back the clock and going back to a time where if you wanted to be online, you had to create your own website because there’s technical barriers to that, there’s cost barriers. And you only need to look at the explosion of things like sharing video online, there’s not an easy way to share a video online in the same way you can just by putting it on YouTube, or uploading it to Facebook, or onto Twitter, there are technical challenges there.

Laura: It’s not fair to blame anyone for it because using the web today and using these platforms today is part of participating in society. You can’t help it if your school has a Facebook group for all the parents. You can’t help it if you have to use a website that, in order to get some vital information. It’s part of our infrastructure now, particularly nowadays when everyone is suddenly relying video calling and things like that so much more. These are our infrastructure, they are as used and as important as our roads, as our utilities, so we need to have them treated accordingly. And we can’t blame people for using them, especially if there aren’t any alternatives that are better.

Drew: When the suggestion is using these big platforms that it’s easy and it’s free, but is it free?

Laura: No, because you’re paying with your personal information. And I hear a lot of developers saying things like, “Oh well, I’m not interesting, I don’t really care, it’s not really a problem for me.” And we have to think about the fact that we’re often in quite a privileged group. What about people that are more vulnerable? We think about people who have parts of their identity that they don’t necessarily want to share publicly, they don’t want to be outed by platforms to their employers, to their government. People who are in domestic abuse situations, we think about people who are scared of their governments and don’t want to spied on. That’s a huge number of people across the world, we can’t just say, “Oh well, it’s fine for me, so it has to be fine for everybody else,” it’s just not fair.

Drew: It doesn’t have to be a very big issue you’re trying to conceal from the world to be worried about what a platform might share about you.

Laura: Yeah. And the whole thing about privacy is that it isn’t about having something to hide, it’s about choosing what you want to share. So you might not feel like you have anything in particular that you want to hide, but it doesn’t necessarily mean you put a camera in your bedroom and broadcast it 24 hours, there’s things we do and don’t want to share.

Drew: Because there are risks as well in sharing social content, things like pictures of family and friends. That we could be sacrificing other peoples privacy without them really being aware, is that a risk?

Laura: Yeah. And I think that that applies to a lot of different things as well. So it’s not just if you’re uploading things of people you know and then they’re being added to facial recognition databases, which is happening quite a lot of the time. These very dodgy databases, they’ll scrape social media sites to make their facial recognition databases. So Clearview is an example of a company that’s done that, they’ve scraped images off Facebook and used those. But also things like email, you might choose… I’m not going to use Gmail because I don’t want Google to have access to everything in my email, which is everything I’ve signed up for, every event I’m attending, all of my personal communication, so I decide not to use it. But if I’m communicating with someone who uses Gmail, well, they’ve made that decision on my behalf, that everything I email them will be shared with Google.

Drew: You say that, often from a privileged position, we think okay, we’re getting all this technology, all these platforms are being given to us for free, we’re not having to pay for it, all we got to do is… We’re giving up a little bit of privacy, but that’s okay, that’s an acceptable trade-off. But is it an acceptable trade-off?

Laura: No. It’s certainly not an acceptable trade-off. But I think it’s also because you don’t necessarily immediately see the harms that are caused by giving these things up. You might feel like you’re in a safe situation today, but you may not be tomorrow. I think a good example is Facebook, they’ve actually got a pattern for approving or disproving loans based on the financial status of your friends on Facebook. So thinking, oh well, if your friend owes lots of money, and a lot of your friends owes lots of money, you’re more likely to be in that same situation as them. So all these systems, all of these algorithms, they are making decisions and influencing our lives and we have no say on them. So it’s not necessarily about what we’re choosing to share and what we’re choosing not to share in terms of something we put in a status, or a photo, or a video, but it’s also about all of this information that is derived about us from our activity on these platforms.

Laura: Things about our locations or whether we have a tendency to be out late at night, the kinds of people that we tend to spend our time with, all of this information can be collected by these platforms too and then they’ll make decisions about us based on that information. And we not only don’t have access to what’s being derived about us, we have no way of seeing it, we have no way of changing it, we have no way of removing it, bar a few things that we could do if we’re in the EU based on GDPR, if you’re in California based on their regulation there that you can go in and ask companies what data they have on you and ask them to delete it. But then what data counts under that situation? Just the data they’ve collected about you? What about the data they’ve derived and created by combining your information with other people’s information and the categories they’ve put you in, things like that. We have no transparency on that information.

Drew: People might say that this is paranoia, this is tinfoil hat stuff. And really all that these companies are doing is collecting data to show us different ads. And okay, there’s the potential for these other things, but they’re not actually doing that. All they’re doing is just tailoring ads to us. Is that the case or is this data actually actively being used in more malicious ways than just showing ads?

Laura: No. We’ve seen in many, many occasions how this information is being used in ways other than just ads. And even if one company decides to just collect it based on ads, they then later might get sold to or acquired by an organization that decides to do something different with that data and that’s parts of the problem with collecting the data at all in the first place. And it’s also a big risk to things like hacking, if you’re creating a big centralized database with people’s information, their phone numbers, their email addresses, even just the most simple stuff, that’s really juicy data for hackers. And that’s why we see massive scale hacks that result in a lot of people’s personal information ending up being publicly available. It’s because a company decided it was a good idea to collect of that information in one place in the first place.

Drew: Are there ways then that we can use these platforms, interact with friends and family that are also on these platforms, Facebook is the obvious example where you might have friends and family all over the world and Facebook is the place where they communicate. Are there ways that you can participate in that and not be giving up privacy or is it just something that if you want to be on that platform, you just have to accept?

Laura: I think there’s different layers, depending on what we would call your threat model is. So depending how vulnerable you are, but also your friends and family, and what your options are. So yeah, the ultimate thing is to not use these platforms at all. But if you do, try to use them more than they use you. So if you have things that you’re communicating one-on-one, don’t use Messenger for that because there are plenty of alternatives for one-on-one direct communication that can be end-to-end encrypted or is private and you don’t have to worry about Facebook listening in on it. And there’s not really much you can do about things like sharing your location data and stuff like that, which is really valuable information. It’s all of your meta information that’s so valuable, it’s not even necessarily the content of what you’re saying, but who you’re with and where you are when you’re saying it. That’s the kind of stuff that’s useful that companies would use to put you in different categories and be able to sell things to you accordingly or group you accordingly.

Laura: So I think we can try to use them as little as possible. I think it’s important to seek alternatives, particularly if you’re a person who is more technically savvy in your group of friends and family, you can always encourage other people to join other things as well to have. So use Wire for messaging, that’s a nice little platform that’s available in lots of places and is private. Or Signal is another option that’s just like WhatsApp but it’s end-to-end encrypted as well. And if you can be that person, I think there’s two points that we have to really forget about. One, is the idea that everyone needs to be on a platform for it to be valuable. The benefit is that everyone’s on Facebook, that’s actually the downside as well, that everyone’s on Facebook. You don’t need everyone you know to suddenly be on the same platform as you. As long as you have those few people you want to communicate with regularly on a better platform, that’s a really good start.

Laura: And the other thing that we need to embrace, we’re not going to find an alternative to a particular platform that does everything that platform does as well. You’re not going to find an alternative to Facebook that does messaging, that has status updates, that has groups, that has events, that has live, that has all of this stuff. Because the reason Facebook can do that is because Facebook is massive, Facebook has these resources, Facebook has a business model that really makes a lot out of all that data and so it’s really beneficial to provide all those services to you. And so we have to change our expectations and maybe be like, “Well okay, what’s the one function I need? To be able to share a photo. Well, let’s find the thing that I can do that will help me just share that photo.” And not be expecting just another great big company to do the right thing for us.

Drew: Is this something that RSS can help us with? I tend to think RSS is the solution to most problems, but I was thinking here if you have a service for photo sharing, and something else for status updates, and something else for all these different things is RSS the solution that brings it all together to create a virtual… That encompasses all these services?

Laura: I’m with you on that for lots of things. I, myself, I’ve built into my own site, I have a section for photos, a section for status updates, as well as my blog and stuff. So that I can allow people to, if they don’t follow me on social media platforms, if I’m posting the same stuff to my site, they can use RSS to access it and they’re not putting themselves at risk. And that’s one of the ways that I see as just a fairly ordinary designer/developer that I can not force other people to use those platforms in order to join in with me. And RSS is really good for that. RSS can have tracking, I think people can do stuff with it, but it’s rare and it’s not the point of it. That’s what I think RSS is a really good standard for.

Drew: As a web developer, I’m aware when I’m building sites that I’m frequently being required to add JavaScript from Google for things like analytics or ads, and from Facebook for like and share actions, and all that sort of thing, and from various other places, Twitter, and you name it. Are those something that we need to worry about in terms of developers or as users of the web? That there’s this code executing that it’s origin is on google.com or facebook.com?

Laura: Yes. Absolutely. I think Google is a good example here of things like web fonts and libraries and stuff like that. So people are encouraged to use them because they’re told well, it’s going to very performant, it’s on Google servers, Google will grab it from the closest part of the world, you’ll have a brilliant site just by using, say a font off Google rather than embedding it, self-hosting it on your own site. There’s a reason why Google offers up all of those fonts for free and it’s not out of the goodness of their Googley little hearts, it is because they get something out of it. And what they get is, they get access to your visitors on your website when you include their script on your website. So I think it’s not just something we should be worried about as developers, I think that it’s our responsibility to know what our site is doing and know what a third party script is doing or could do, because they could change it and you don’t necessarily have control over that as well. Know what their privacy policies are and things like that before we use them.

Laura: And ideally, don’t use them at all. If we can self-host things, self-host things, a lot of the time it’s easier. If we don’t need to provide a login with Google or Facebook, don’t do it. I think we can be the gatekeepers in this situation. We as the people who have the knowledge and the skills in this area, we can be the ones that can go back to our bosses or our managers and say, “Look, we can provide this login with Facebook or we could build our own login, it will be private, it would be safer. Yeah, it might take a little bit more work but actually we’ll be able to instill more trust in what we’re building because we don’t have that association with Facebook.” Because what we’re seeing now, over time, is that even mainstream media is starting to catch up with the downsides of Facebook, and Google, and these other organizations.

Laura: And so we end up being guilty by association even if we’re just trying to make the user experience easier by adding a login where someone doesn’t have to create a new username and password. And so I think we really do need to take that responsibility and a lot of it is about valuing people’s rights and respecting their rights and their privacy over our own convenience. Because of course it’s going to be much quicker just to add that script to the page, just to add another package in without investigating what it actually does. We’re giving up a lot when we do that and I think that we need to take responsibility not to.

Drew: As web developers are there other things that we should be looking out for when it comes to protecting the privacy of our own customers in the things that we build?

Laura: We shouldn’t be collecting data at all. And I think most of the time, you can avoid it. Analytics is one of my biggest bugbears because I think that a lot of people get all these analytics scripts, all these scripts that can see what people are doing on your website and give you insights and things like that, but I don’t think we use them particularly well. I think we use them to confirm our own assumptions and all we’re being taught about is what is already on our site. It’s not telling us anything that research and actually talking to people who use our websites… We could really benefit more from that than just looking at some numbers go up and down, and guessing what the effect of that is or why it’s happening. So I think that we need to be more cautious around anything that we’re putting on our sites and anything that we’re collecting. And I think nowadays we’re also looking at regulatory and legal risks as well when we’re starting to collect people’s data.

Laura: Because when we look at things like the GDPR, we’re very restricted in what we are allowed to collect and the reasons why we’re allowed to collect it. And that’s why we’re getting all of these consent notifications and things like that coming up now. Because companies have to have your explicit consent for collecting any data that is not associated with vital function for the website. So if you’re using something like a login, you don’t need to get permission to store someone’s email and password for a login because that is implied by logging in, you need that. But things like analytics and stuff like that, you actually need to get explicit consent in order to be able to spy on the people visiting the website. So this is why we see all of these consent boxes, this is why we should actually be including them on our websites if we’re using analytics and other tools that are collecting data that aren’t vital to the functioning of the page.

Drew: I think about some of even just the side projects and things that I’ve launched, that just almost as a matter of routine I’ve put Google analytics on there. I think, “Oh, I need to track how many people are visiting.” And then I either never look at it or I only look at it to gain an understanding of the same things that I could’ve just got from server logs like we used to do in the old days, just by crunching over their web access logs.

Laura: Exactly. And yet Google is sitting there going, “Thank you very much.” Because you’ve instilled another input for them on the website. And I think once you start thinking about it, once you adjust your brain to taking this other way of looking at it, it’s much easier to start seeing the vulnerabilities. But we do have to train ourselves to think in that way, to think about how can we harm people with what we’re building, who could lose out from this, and try to build things that are a bit more considerate of people.

Drew: There’s an example, actually, that I can think of where Google analytics itself was used to breach somebody’s privacy. And that was the author of Belle de Jour, The Secret Diary of a Call Girl, who was a London call girl who kept a blog for years and it was all completely anonymous. And she diarized her daily life. And it was incredibly successful, and it became a book, and a TV series, and what have you. She was intending to be completely anonymous, but she was eventually found out. Her identity was revealed because she used the same Google analytics tracking user id on her personal blog where she was her professional self and on the call girl blog as well. And that’s how she was identified, just-

Laura: So she did it to herself in that way as well.

Drew: She did it to herself. Yeah. She leaked personal data there that she didn’t mean to leak. She didn’t even know it was personal data, I suspect. There are so many implications that you just don’t think of. And so I think it pays to start thinking of it.

Laura: Yeah. And not doing things because you feel that that’s what we always did, and that’s what we always do, or that’s what this other organization that I admire, they do it, so I should, I think. And a lot of the time it is about being a bit more restrictive and maybe not jumping on the bandwagon of I’m going to use this service like everybody else is. And stopping, reading their privacy policy, which is not something I recommend doing for fun, because it’s really tedious, and I have to do a lot of it when I’m looking into trackers for Better. But you can see a lot of red flags if you read privacy policies. You see the kinds of language that means that they’re trying to make it free and easy for them to do whatever they want with your information. And there’s a reason why I say to designers and developers, if you’re making your own projects, don’t just copy the privacy policy from somebody else. Because you might be opening yourself up to more issues and you might actually be making yourself look suspicious.

Laura: It’s much better to be transparent and clear about what you’re doing, everything doesn’t need to be written in legal ease in order for you to be clear about what you’re doing with people’s information.

Drew: So, in almost anything, people say that the solution to it is to use the JAMstack. Is the JAMstack a solution, is it a good answer, is it going to help us out of accidentally breaching the privacy of our customers?

Laura: There’s a lot of stuff I like about the JAMstack stuff, but I would say I like the “JMstack”, because it’s the APIs bit that worries me. Because if we’re taking control over our own sites, we’re building static sites, and we’re generating it all on our machines, and we’re not using servers, and that’s great that we’ve taken away a lot potential issues there. But then if we’re adding back in all of the third party functionality using APIs, we may as well be adding script tags to our pages all over again. We may as well have it on somebody else’s platform. Because we’re losing that control again. Because every time we’re adding something from a third party, we’re losing control over a little bit of our site. So I think that a lot of static site generators and things like that have a lot of value, but we still need to be cautious.

Laura: And I think one of the reasons why we love the jam stack stuff because again, it’s allowed us to knock up a site really quickly, deploy it really quickly, have a development environment set up really quickly, and we’re valuing again, our developer experience over that of the people that are using the websites.

Drew: So I guess the key there is to just be hyperaware of what every API you’re using is doing. What data you could be sending to them, what their individual privacy policies are.

Laura: Yeah. And I think we have to be cautious about being loyal to companies. We might have people that we are friends with and think are great and things like that, that are working for these companies. We might that they are producing some good work, they’re doing good blogs, they’re introducing some interesting new technologies into the world. But at the end of the day, businesses are businesses. And they all have business models. And we have to know what are their business models. How are they making their money? Who is behind the money? Because a lot of venture capital backed organizations end up having to deal in personal data, and profiling, and things like that, because it’s an easy way to make money. And it is hard to build a sustainable business on technology, particularly if you’re not selling a physical product, it’s really hard to make a business sustainable. And if an organization has taken a huge amount of money and they’re paying a huge amount of employees, they’ve got to make some money back somehow.

Laura: And that’s what we’re seeing now is, so many businesses doing what Shoshana Zuboff refers to as surveillance capitalism, tracking people, profiling them, and monetizing that information because it’s the easiest way to make money on the web. And I think that the rest of us have to try to resist it because it can be very tempting to jump in and do what everyone else is doing and make big money, and make a big name. But I think that we’re realizing too slowly the impact that that has on the rest of our society. The fact that Cambridge Analytica only came about because Facebook was collecting massive amounts of people’s information and Cambridge Analytica was just using that information in order to target people with, essentially, propaganda in order to make referendums and elections of their way. And that’s terrifying, that’s a really scary effect that’s come out of what you might think is an innocuous little banner ad.

Drew: Professionally, many people are transitioning into building client sites or helping their clients to build their own sites on platforms like Squarespace and that sort of thing, online site builders where sites are then completely hosted on that service. Is that an area that they should also be worried about in terms of privacy?

Laura: Yeah. Because you’re very much subject to the privacy policies of those platforms. And while a lot of them are paid platforms, so just because it’s a platform doesn’t necessarily mean that they are tracking you. But the inverse is also true, just because you’re paying for it, doesn’t mean they’re not tracking you. I’d use Spotify as an example of this. People pay Spotify a lot of money for their accounts. And Spotify does that brilliant thing where it shows off how much it’s tracking you by telling people all of this incredible information about them on a yearly basis, and giving them playlists for their moods, and things like that. And then you realize, oh, actually, Spotify knows what my mood is because I’m listening to a playlist that’s made for this mood that I’m in. And Spotify is with me when I’m exercising. And Spotify knows when I’m working. And Spotify knows when I’m trying to sleep. And whatever other playlists you’ve set up for it, whatever other activities you’ve done.

Laura: So I think we just have to look at everything that a business is doing in order to work out whether it’s a threat to us and really treat everything as though it could possibly cause harm to us, and use it carefully.

Drew: You’ve got a fantastic personal website where you collate all the things that you’re working on and things that you share socially. I see that your site is built using Site.js. What’s that?

Laura: Yes. So it’s something that we’ve been building. So what we do at the Small Technology Foundation, or what we did when we were called Ind.ie, which was the UK version of the Small Technology Foundation, is that we’re tying to work on how do we help in this situation. How do we help in a world where technology is not respecting people’s rights? And we’re a couple of designers and developers, so what is our skills? And the way we see it is we have to do a few different things. We have to first of all, prevent some of the worst harms if we can. And one of the ways we do that is having a tracker blocker, so it’s something that blocks trackers on the web, with their browser. And another thing we do is, we try to help inform things like regulation, and we campaign for better regulation and well informed regulation that is not encouraging authoritarian governments and is trying to restrict businesses from collecting people’s personal information.

Laura: And the other thing we can do is, we can try to build alternatives. Because one of the biggest problems with technology and with the web today is that there’s not actually much choice when you want to build something. A lot of things are built in the same way. And we’ve been looking at different ways of doing this for quite a few years now. And the idea behind Site.js is to make it really easy to build and deploy a personal website that is secure, has the all the HTTPS stuff going on and everything, really, really, easily. So it’s something that really benefits the developer experience, but doesn’t threaten the visitor’s experience at the same time. So it’s something that is also going to keep being rights respecting, that you have full ownership and control over as the developer of your own personal website as well. And so that’s what Site.js does.

Laura: So we’re just working on ways for people to build personal websites with the idea that in the future, hopefully those websites will also be able to communicate easily with each other. So you could use them to communicate with each other and it’s all in your own space as well.

Drew: You’ve put a lot of your expertise in this area to use with Better Blocker. You must see some fairly wild things going on there as you’re updating it and…

Laura: Yeah. You can always tell when I’m working on Better because that’s when my tweets get particularly angry and cross, because it makes me so irritated when I see what’s going on. And it also really annoys me because I spend a lot of time looking at websites, and working out what the scripts are doing, and what happens when something is blocked. One of the things that really annoys me is how developers don’t have fallbacks in their code. And so the amount of times that if you block something, for example, I block an analytics script, and if you block an analytics script, all the links stop working on the webpage, then you’re probably not using the web properly if you need JavaScript to use a link. And so I wish that developers bear that in mind, especially when they think about maybe removing these scripts from their sites. But the stuff I see is they…

Laura: I’ve seen, like The Sun tabloid newspaper, everybody hates it, it’s awful. They have about 30 different analytics scripts on every page load. And to some degree I wonder whether performance would be such a hot topic in the industry if we weren’t all sticking so much junk on our webpages all the time. Because, actually, you look at a website that doesn’t have a bunch of third party tracking scripts on, tends to load quite quickly. Because you’ve got to do a huge amount to make a webpage heavy if you haven’t got all of that stuff as well.

Drew: So is it a good idea for people who build for the web to be running things like tracker blockers and ad blockers or might it change our experience of the web and cause problems from a developer point of view?

Laura: I think in the same way that we test things across different browsers and we might have a browser that we use for our own consumer style, I hate the word consumer, use, just our own personal use, like our shopping and our social stuff, and things like that. And we wouldn’t only test webpages in that browser, we test webpages in as many browsers can get our hands on because that’s what makes us good developers. And I think the same should be for if you’re using a tracker blocker or an ad blocker in your day-to-day, then yeah, you should try it without as well. Like I keep Google Chrome on my computer for browser testing, but you can be sure that I will not be using that browser for any of my personal stuff, ever, it’s horrible. So yeah, you’ve got to be aware of what’s going in the world around you as part of your responsibility as a developer.

Drew: It’s almost just like another browser combination, isn’t it? To be aware of the configurations that the audience your site or your product might have and then testing with those configurations to find any problems.

Laura: Yeah. And also developing more robust ways of writing your code, so that your code can work without certain scripts and things like that. So not everything is hinging off one particular script unless it is absolutely necessary. Things completely fall apart when people are using third party CDNs, for example. I think that’s a really interesting thing that so many people decided to use a third party CDN, but you have very little control over it’s uptime and stuff like that. And if you block the third party CDN, what happens? Suddenly you have no images, no content, no videos, or do you have no functionality because all of your functional JavaScript is coming from a third party CND?

Drew: As a web developer or designer, if I’d not really thought about privacy concerns about the sites I’m producing up until this point, if I wanted to make a start, what should be the first thing that I do to look at the potential things I’m exposing my customers to?

Laura: I’d review one of your existing pages or one of your existing sites. And you can take it on a component by component basis even. I think any small step is better than no step. And it’s the same way you’d approach learning anything new. It’s the same way I think about accessibility as well. Is you start by, okay, what is one thing I can take away? What is one thing I can change that will make a difference? And then you start building up that way of thinking, that way of looking at how you’re doing your work. And eventually that will build up into being much more well informed about things.

Drew: So I’ve been learning a lot about online privacy. What have you been learning about lately?

Laura: One of the things I’ve been learning about is Hugo, which is a static site generator that is written using Go. And I use it for my personal site already, but right now for Site.js, I’ve been writing a starter blog theme so that people could just set up a site really easily and don’t necessarily have to know a lot about Hugo. Because Hugo is interesting, it’s very fast, but the templating is quite tricky and the documentation is not the most accessible. And so I’m trying to work my way through that to understand it better, which I think I finally got over the initial hurdle. Where I understand what I’m doing now and I can make it better. But it’s hard learning these stuff, isn’t it?

Drew: It really is.

Laura: It reminds you how inadequate you are sometimes.

Drew: If you, dear listener, would like to hear more from Laura, you can find her on the web at laurakalbag.com and Small Technology Foundation at small-tech.org. Thanks for joining us today, Laura. Do you any parting words?

Laura: I’d say, I think we should always just be examining what we’re doing and our responsibility in the work that we do. And what can we do that can make things better for people? And what we can do to make things slightly less bad for people as well.

(il)
Categories: Others Tags:

A Grid of Logos in Squares

April 6th, 2020 No comments

Let’s build a literal grid of squares, and we’ll put the logos of some magazines centered inside each square. I imagine plenty of you have had to build a logo grid before. You can probably already picture it: an area of a site that lists the donors, sponsors, or that is showing off all the big fancy companies that use some product. Putting the logos into squares is a decent way of handling it, as it forces some clean structure amongst logos that are all different sizes, aspect ratios, and visual weights, which can get finicky and look sloppy.

By “grid” I mean CSS grid. Setting up a grid of (flexible) squares is a little trick of its own. Then we’ll plop those logos in there in a way that keeps them sized and centered. At the end, we’ll look at one little oddity.

1) Grid markup

Have you ever tried this in an editor that supports Emmet?

.grid>div*5>img

Then press tab. It will expand out into:

<div class="grid">
  <div><img src="" alt=""></div>
  <div><img src="" alt=""></div>
  <div><img src="" alt=""></div>
  <div><img src="" alt=""></div>
  <div><img src="" alt=""></div>
</div>

Just a little trick for working quickly.

2) CSS Grid basics

We’ll use the infamous flexible columns technique:

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-gap: 1rem;
}

That will give us not only flexible columns, but a flexible number of columns. Remember, we don’t really care how many columns there are — we’re just building a grid of logos to display.

If we give each of those grid item divs a background and a forced height, we’d see something like:

This screenshot is at a parent width of about 800px. The three columns seen here will increase and decrease to fill the space, thanks to that grid magic.

2) Making real squares

Rather than force the grid items to any particular height, let’s use an aspect-ratio trick. We’ll plop an empty pseudo-element in there with padding-bottom: 100%; meaning it will force the height to be at least as tall as it is wide.

.grid > div {
  background: black;
  padding: 1rem;
}

.grid > div::before {
  content: "";
  padding-bottom: 100%;
  display: block;
}

If we temporarily hide the images, you’ll see the grid of rectangles has become a grid of perfect squares:

3) Overlapping the Images

But with the images in there, they grow a little oblong because the image sits in the pseudo-element.

We’ll need a way to sit them on top of one another. Usually, with aspect-ratio techniques, we reach for absolute positioning to place the in-child container to cover the now aspect-ratioed shape. But since we’re using grid already anyway, let’s use grid again to place the items into the same space:

.grid > div {
  /* ... */
  display: grid;
}
.grid > div::before,
.grid > div > img {
  grid-area: 1 / 1 / 2 / 2;
}

That says to make the grid items of the main grid also into grid containers, with no explicit rows and columns, then to place both the pseudo-element and image onto the first row and column of that grid. This will force them to overlap them, making a nice grid of squares again.

4) Placing the images

Let’s plop a proper src in there for each image. If we make sure the images fill the space (and limit themselves) with width: 100%, we’ll see them along the top of the grid items:

Not terrible, but we would prefer to see them centered. Here’s one trick to do that. First, we’ll also make their height: 100%, which distorts them:

Then fix that up with object-fit!

.grid > div > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

There we go:

That will work responsively:

5) Quirky dragging size

This (probably) isn’t a massive deal, but notice how the logos look when you drag them off (like a user might if they are trying to save one):

The images look like they have width: 100%; height: 100%; without the object-fit: contain;.

Here’s the working demo so far, with that quirk:

CodePen Embed Fallback

6) Use absolute positioning instead

If that dragging quirk is a big deal, we can always just absolutely position the images inside the grid children instead.

Here’s one way, assuming the grid child div is position: relative;:

.grid > div > img {
  position: absolute;
  max-width: 100%;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  margin: auto;
}

And here’s another:

.grid > div > img {
  position: absolute;
  max-width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

Either of those fix that dragging quirk. Here’s a demo:

CodePen Embed Fallback

The post A Grid of Logos in Squares appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

Continuous Deployments for WordPress Using GitHub Actions

April 6th, 2020 No comments

Continuous Integration (CI) workflows are considered a best practice these days. As in, you work with your version control system (Git), and as you do, CI is doing work for you like running tests, sending notifications, and deploying code. That last part is called Continuous Deployment (CD). But shipping code to a production server often requires paid services. With GitHub Actions, Continuous Deployment is free for everyone. Let’s explore how to set that up.

DevOps is for everyone

As a front-end developer, continuous deployment workflows used to be exciting, but mysterious to me. I remember numerous times being scared to touch deployment configurations. I defaulted to the easy route instead — usually having someone else set it up and maintain it, or manual copying and pasting things in a worst-case scenario.

As soon as I understood the basics of rsync, CD finally became tangible to me. With the following GitHub Action workflow, you do not need to be a DevOps specialist; but you’ll still have the tools at hand to set up best practice deployment workflows.

The basics of a Continuous Deployment workflow

So what’s the deal, how does this work? It all starts with CI, which means that you commit code to a shared remote repository, like GitHub, and every push to it will run automated tasks on a remote server. Those tasks could include test and build processes, like linting, concatenation, minification and image optimization, among others.

CD also delivers code to a production website server. That may happen by copying the verified and built code and placing it on the server via FTP, SSH, or by shipping containers to an infrastructure. While every shared hosting package has FTP access, it’s rather unreliable and slow to send many files to a server. And while shipping application containers is a safe way to release complex applications, the infrastructure and setup can be rather complex as well. Deploying code via SSH though is fast, safe and flexible. Plus, it’s supported by many hosting packages.

How to deploy with rsync

An easy and efficient way to ship files to a server via SSH is rsync, a utility tool to sync files between a source and destination folder, drive or computer. It will only synchronize those files which have changed or don’t already exist at the destination. As it became a standard tool on popular Linux distributions, chances are high you don’t even need to install it.

The most basic operation is as easy as calling rsync SRC DEST to sync files from one directory to another one. However, there are a couple of options you want to consider:

  • -c compares file changes by checksum, not modification time
  • -h outputs numbers in a more human readable format
  • -a retains file attributes and permissions and recursively copies files and directories
  • -v shows status output
  • --delete deletes files from the destination that aren’t found in the source (anymore)
  • --exclude prevents syncing specified files like the .git directory and node_modules

And finally, you want to send the files to a remote server, which makes the full command look like this:

rsync -chav --delete --exclude /.git/ --exclude /node_modules/ ./ ssh-user@example.com:/mydir

You could run that command from your local computer to deploy to any live server. But how cool would it be if it was running in a controlled environment from a clean state? Right, that’s what you’re here for. Let’s move on with that.

Create a GitHub Actions workflow

With GitHub Actions you can configure workflows to run on any GitHub event. While there is a marketplace for GitHub Actions, we don’t need any of them but will build our own workflow.

To get started, go to the “Actions” tab of your repository and click “Set up a workflow yourself.” This will open the workflow editor with a .yaml template that will be committed to the .github/workflows directory of your repository.

When saved, the workflow checks out your repo code and runs some echo commands. name helps follow the status and results later. run contains the shell commands you want to run in each step.

Define a deployment trigger

Theoretically, every commit to the master branch should be production-ready. However, reality teaches you that you need to test results on the production server after deployment as well and you need to schedule that. We at bleech consider it a best practice to only deploy on workdays — except Fridays and only before 4:00 pm — to make sure we have time to roll back or fix issues during business hours if anything goes wrong.

An easy way to get manual-level control is to set up a branch just for triggering deployments. That way, you can specifically merge your master branch into it whenever you are ready. Call that branch production, let everyone on your team know pushes to that branch are only allowed from the master branch and tell them to do it like this:

git push origin master:production

Here’s how to change your workflow trigger to only run on pushes to that production branch:

name: Deployment
on:
  push:
    branches: [ production ]

Build and verify the theme

I’ll assume you’re using Flynt, our WordPress starter theme, which comes with dependency management via Composer and npm as well as a preconfigured build process. If you’re using a different theme, the build process is likely to be similar, but might need adjustments. And if you’re checking in the built assets to your repository, you can skip all steps except the checkout command.

For our example, let’s make sure that node is executed in the required version and that dependencies are installed before building:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    
    - uses: actions/setup-node@v1.1.0
      with:
        version: 12.x

    - name: Install dependencies
      run: |
        composer install -o
        npm install

    - name: Build
      run: npm run build

The Flynt build task finally requires, lints, compiles, and transpiles Sass and JavaScript files, then adds revisioning to assets to prevent browser cache issues. If anything in the build step fails, the workflow will stop executing and thus prevents you from deploying a broken release.

Configure server access and destination

For the rsync command to run successfully, GitHub needs access to SSH into your server. This can be accomplished by:

  1. Generating a new SSH key (without a passphrase)
  2. Adding the public key to your ~/.ssh/authorized_keys on the production server
  3. Adding the private key as a secret with the name DEPLOY_KEY to the repository

The sync workflow step needs to save the key to a local file, adjust file permissions and pass the file to the rsync command. The destination has to point to your WordPress theme directory on the production server. It’s convenient to define it as a variable so you know what to change when reusing the workflow for future projects.

- name: Sync
  env:
    dest: 'ssh-user@example.com:/mydir/wp-content/themes/mytheme'
  run: |
    echo "${{secrets.DEPLOY_KEY}}" > deploy_key
    chmod 600 ./deploy_key
    rsync -chav --delete 
      -e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' 
      --exclude /.git/ 
      --exclude /.github/ 
      --exclude /node_modules/ 
      ./ ${{env.dest}}

Depending on your project structure, you might want to deploy plugins and other theme related files as well. To accomplish that, change the source and destination to the desired parent directory, make sure to check if the excluded files need an update, and check if any paths in the build process should be adjusted.

Put the pieces together

We’ve covered all necessary steps of the CD process. Now we need to run them in a sequence which should:

  1. Trigger on each push to the production branch
  2. Install dependencies
  3. Build and verify the code
  4. Send the result to a server via rsync

The complete GitHub workflow will look like this:

name: Deployment

on:
  push:
    branches: [ production ]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-node@v1.1.0
      with:
        version: 12.x

    - name: Install dependencies
      run: |
        composer install -o
        npm install

    - name: Build
      run: npm run build
    
    - name: Sync
      env:
        dest: 'ssh-user@example.com:/mydir/wp-content/themes/mytheme'
      run: |
        echo "${{secrets.DEPLOY_KEY}}" > deploy_key
        chmod 600 ./deploy_key
        rsync -chav --delete 
          -e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' 
          --exclude /.git/ 
          --exclude /.github/ 
          --exclude /node_modules/ 
          ./ ${{env.dest}}

To test the workflow, commit the changes, pull them into your local repository and trigger the deployment by pushing your master branch to the production branch:

git push origin master:production

You can follow the status of the execution by going to the “Actions” tab in GitHub, then selecting the recent execution and clicking on the “deploy“ job. The green checkmarks indicate that everything went smoothly. If there are any issues, check the logs of the failed step to fix them.

Check the full report on GitHub


Congratulations! You’ve successfully deployed your WordPress theme to a server. The workflow file can easily be reused for future projects, making continuous deployment setups a breeze.

To further refine your deployment process, the following topics are worth considering:

  • Caching dependencies to speed up the GitHub workflow
  • Activating the WordPress maintenance mode while syncing files
  • Clearing the website cache of a plugin (like Cache Enabler) after the deployment

The post Continuous Deployments for WordPress Using GitHub Actions appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

How Can Visual Content Increase Social Engagement for Your Business?

April 6th, 2020 No comments

Visuals have the power to attract the attention of consumers. Marketers have realized this, and that’s why 80% of them have started using visual images.

Chart showing the types of visual content used
Image Source: Social Media Examiner

Additionally, 63% of marketers use video, while 35% of them use live video. They also consider visual images the most important form of content. Nearly 32% of marketers say it’s the best form of visual content. Image Source: Social Media Examiner

Visual marketing is the key to attracting and engaging your audience on social media. Visuals can get their attention as they scroll through their news feed due to their colorful and attractive nature, unlike text, which tends to look dull.

What’s more?

People are incredibly good at remembering visuals. In fact, when people hear information accompanied by images, they retain 65% of it.

But how can visuals increase social engagement for your business? Let’s find out.

How Visual Content Increases Social Engagement

The following are several ways through which the use of visuals can help increase engagement on your social media posts.

1. Visual Content Makes Your Content Shareable

Images, videos, infographics, and GIFs drive engagement, but their share-worthiness contributes a lot to this. Make sure that it’s easy for your audience to share content across social platforms to increase exposure.

However, for the content to be shareworthy, your audience needs to be able to relate to it. If it’s not tailored to their requirements, they may not engage with it.

Hashtag campaigns are one great way to make your posts shareable and increase engagement. You can use branded and campaign-specific hashtags in your posts to promote them and encourage your followers to create and share content around a chosen topic.

To monitor the popularity of these hashtags, you can use hashtag tracking tools like Brand24 and BuzzSumo.

KitKat Visual Content examples
Image source: Instagram

KitKat uses hashtags to increase engagement. They encourage their audience to share videos and photos with the hashtag #Haveabreak or #haveabreakhaveakitkat. The user-generated photos and videos increase the visibility of their brand and content, which can lead to an increase in engagement too.

2. Visual Content Helps Convey Information

Given a choice between text information and videos, 66% of consumers would rather watch videos to learn about products, according to a Wyzowl study.

Chart showing the distribution of visual content types
Image source: HubSpot

HubSpot also found that consumers prefer video over other forms of branded content. In fact, 43% of them said that videos are the most memorable form of content as compared to just 18% of them going with text.

Graphic that shows the effect of infographics as visual content.
Image source: Infographic World

Infographic World also found that visuals influence consumers’ purchase decisions and make them think deeply about a subject. Image via Infographic World

Additionally, 61% of consumers in the HubSpot survey said that they wanted to learn something new from videos. This shows the importance of visuals in conveying information and generating engagement.

By using visuals to convey helpful information, you can get the attention of your target audience. This is because they’ll get exactly what they’re looking for, and as a result, be more likely to engage with the post.

You need to understand your target consumers’ needs and topics they hold dear. Then you can use that information to create visual posts that not only entertain but also educate them on your products.

3. Visual Content Connects with Your Audience Emotionally

If moved by your content, your audience will associate the feelings they feel while reading it with your brand. People tend to like, share, or comment on posts based on their emotions.

The content could have made them laugh, cringe, gasp, or cry. Whichever the case, feelings cause them to take action.

In fact, in a study on what drives the sharing of video ads, researchers found that ads that evoked positive feelings led to more sharing. Using drama, surprise plots, etc. also sparked emotions that induced sharing.

Implementing the same factors when writing your social posts could lead to more engagement. You can arouse strong emotions using captivating plots, authentic characters, surprise endings, and inspiring stories.

Hit the right emotions on your social posts to drive engagement. Your followers will then enjoy liking, sharing, and commenting on your posts.

You can engage your audience with branded explainer videos or webinars. Help consumers imagine themselves experiencing the product. Remember, however, that too much branding could push them away.

Instead, understand their needs and engage them with powerful messages.

Understand what emotions drive viral content and include them in your visual content. These emotions include curiosity, interest, uncertainty, admiration, astonishment, and amazement. Think about how you can weave your brand into this content and post it on social media.

For instance, you could show images of your products, services, or employees doing some good in the world. Your customers will notice this and may want to be associated with you.

In fact, 53% of millennials are willing to pay a premium of 10% or more for socially responsible brands.

Chart showing the effect of social responsible visual content over millennials.
Image Source: Roth

By being cause-driven, you can drive more engagement on your posts on social media as you can connect to your audience’s emotions.

4. Visual Content in Varying Formats Drives More Engagement

People react differently to various types of visuals. However, to maximize the chances of them engaging with your content, you need to figure out which visuals they like.

Create various forms of visual content, such as infographics, videos, memes, GIFs, and others.

Check the kind of response you get from each, and you will understand what kind of visuals work best with your target audience. Use more of these visuals to drive your engagement.

Remember, each type of visual will appeal to different parts of your target audience. So, by alternating between the various types of visuals, you’ll be able to generate more engagement.

To increase engagement even further, you can embed your visual content on your blog so that those who visit your blog can engage with it. Embed tweets, posts, and pins from the social media platforms on the blog so that your site visitors can like and follow your posts from the blog.

Another way to handle this is through embedded shareable links. As the readers go through your blog post, they can easily share content from your blog to their social media feeds.

Example of a visual content format on Facebook
Image Source: Post Planner

For example, the writer of this blog post included an embedded shareable link in their post. If the reader feels inspired while they read, they can tweet directly to their Twitter account using the link.

Collaborating with influencers can also help you get new visual content and grow your engagement. Their followers will engage with their posts, and might end up engaging with your content too. Additionally, you’ll get fresh visual content to share on your social media accounts and drive your engagement even further.

Ready to Increase Your Social Engagement?

Attractive visuals can catch the attention of your target audience, who may end up sharing your content. However, you must ensure that the visuals you use are relevant for your audience and that they complement the rest of your content. They should also suit your brand’s personality.

If your visual content delivers helpful information to your audience, they’ll likely engage with it and increase your social engagement. Additionally, visuals can evoke different emotions in your audience, and this can nudge them to engage with your content.

Lastly, there are various forms of visuals that you can use for your brand. Find the ones that your audience likes and incorporate those in your social media strategy. Each type of visual will appeal to a different segment of your audience, and you need to figure out which ones can drive your engagement and use them.

Do you have any questions about using visual content to drive social engagement? Let us know in the comments.

Categories: Others Tags:

Create Your Free Developer Blog Using Hugo And Firebase

April 6th, 2020 No comments

Create Your Free Developer Blog Using Hugo And Firebase

Create Your Free Developer Blog Using Hugo And Firebase

Zara Cooper

2020-04-06T11:30:00+00:002020-04-07T09:06:51+00:00

In this tutorial, I’ll demonstrate how to create your own blog using Hugo and deploy it on Firebase for free. Hugo is an open-source static site generator and Firebase is a Google platform that offers resources and services used to augment web and mobile development. If you’re a developer who does not have a blog yet but is interested in hosting one, this article will help you create one. To follow these steps, you need to know how to use Git and your terminal.

Having your own technical blog can have tons of benefits to your career as a developer. For one, blogging about technical topics makes you learn things you might not have otherwise picked up at your primary developer job. As you research your pieces or try new things, you end up learning a whole host of things like how to work with new technologies and solve edge case problems. In addition to that, you get to practice soft skills like communication and dealing with criticism and feedback when you engage with your reader’s comments.

Additionally, you become more self-assured in your software development skills because you get to write so much code when building sample projects for your blog to illustrate concepts. A technical blog augments your brand as a developer since it gives you a platform to showcase your skills and expertise. This opens you up to all kinds of opportunities like jobs, speaking and conference engagements, book deals, side businesses, relationships with other developers, and so on.

Recommended Reading on SmashingMag:

Chris Sevilleja, for example, started writing tutorials in 2014 on his blog scotch.io that turned into a business that later joined Digital Ocean. Another significant benefit of having a technical blog is that it makes you a better writer which can be an asset in your job when writing software design and technical spec documents. Moreover, it makes you an exceptional teacher and mentor. For example, I often read research.swtch.com, a blog by Russ Cox who blogs about the Go language and also works on the Google Go team that builds it. From it, I’ve learned a ton about how the language works that I might not have picked up from my main job.

Another great blog I also enjoy reading and learning a lot from is welearncode.com by Ali Spittel who once wrote that a really great part of blogging is:

“Helping other people learn how to code and making it easier for the people coming after me.”

A fairly easy and painless way to get your blog up and running is to use a third-party platform like Medium where you only have to create an account to get a blog. Although these platforms may suit most blogging needs at the start, they do have some drawbacks in the long run.

Some platforms offer bad user experiences like constantly sending distracting notifications for trivial things, asking for app installs, and so on. If your reader has a bad experience on a platform where your blog is hosted they are less likely to engage with your content. Besides that, tools you may need to enhance your reader’s interaction with and time on your blog may not be supported. Things like RSS feeds, syntax highlighting for code snippets among other things may not be supported on the platform. In a worst-case scenario, the platform where your blog is hosted may close and you may lose all the work you’ve done.

Hosting your own blog and redirecting your users to it increases the chances that they will be more engaged with the posts you put out. You won’t have to compete for your reader’s attention with other writers on a platform since you’ll be the only one on it. Readers are likely to read more of your posts or sign up for your newsletter since they’re more focused on what you’re communicating. Another plus that comes with hosting your own blog is the ability to customize it in a myriad of ways to your own tastes, which is usually not possible with third-party platforms.

Setting Up Hugo

If you’re working on macOS or Linux, the easiest way to install Hugo is to use Homebrew. All you’ll need to run on your terminal is:

brew install hugo

If you’re running on windows, Hugo can be installed using either the scoop installer or the chocolatey package manager. For scoop:

scoop install hugo 

For chocolatey:

choco install hugo -confirm

If none of these options apply to you, check out these options for installation.

Setting Up Firebase Tools

To install firebase tools, you need to have Node.js installed to get access to npm. To install Firebase tools, run:

npm install -g firebase-tools

Create a Firebase account for free at this link. You’ll need a Google account for this. Next, login using the Firebase tools. You’ll be redirected to a browser tab where you can log in using your Google account.

firebase login

Create Your Blog

Pick a directory where you’d like your blog’s source code to reside. Change location to that directory on your terminal. Pick a name for your blog. For the purposes of this tutorial, let’s name the blog sm-blog.

hugo new site sm-blog

It’s advisable to back up your site’s source code in case anything goes wrong. I’m going to use Github for this but you could use any version control service — if you choose to do the same. I’ll initialize a repository.

cd sm-blog
git init

Before we can run the site locally and actually view it on the browser, we need to add a theme otherwise all you’ll see is a blank page.

Picking And Installing A Theme For Your Blog

One thing I love about Hugo is the community behind it and all the developers who submit themes for the community to use. There is a vast array of themes to choose from, everything from small business websites, portfolios to blogs. To pick a blog theme, head on over to the blog section of themes.gohugo.io. I picked a theme called Cactus Plus because of its simplicity and minimalism. To install this theme, I’ll need to add it as a submodule of my repository. Many themes instruct its users to use submodules for installs but if this is not the case, just follow the instructions given by the theme maker provided in the description. I’ll add the theme to the /themes folder.

git submodule -b master add https://github.com/nodejh/hugo-theme-cactus-plus.git theme/hugo-theme-cactus-plus

At the root of the blog folder, there exists a generated file, config.toml. This is where you specify settings for your site. We’ll need to change the theme there. The theme name corresponds to the chosen theme’s folder name in the /themes folder. These are the contents of the config.toml file now. You could also change the title of the blog.

baseURL = "http://example.org/"
languageCode = "en-us"
title = "SM Blog"
theme="hugo-theme-cactus-plus"

Now we can run the blog. It will look exactly like the theme with the exception of the name change. Once you run the server, head on over to http://localhost:1313 on your browser.

hugo server -D

Personalizing Your Blog

One benefit of deploying your own blog is getting to personalize it to your liking in all kinds of ways. The primary way to do this with Hugo is to change the theme you selected. Many themes provide customization options through the config.toml. The theme creator usually provides a list of options and what they all mean in the description on the theme page. If they don’t, check out the /exampleSite folder of the theme and copy the contents of config.toml within that folder to your config.toml file. For example:

cp themes/hugo-theme-cactus-plus/exampleSite/config.toml .

Since all themes are different, changes I make here may not apply to your theme but hopefully, you may be able to get an idea of what to do with your blog.

  1. I’ll change the avatar image and the favicon of the blog. All static files including images should be added to the /static folder. I created an /images folder within static and added the images there.
  2. I’ll add Google Analytics so I can track the traffic to my blog.
  3. I’ll enable Disqus so my readers can leave comments on my posts.
  4. I’ll enable RSS.
  5. I’ll put in my social links to Twitter and Github.
  6. I’ll enable the Twitter card.
  7. I’ll enable summaries under the post titles on the home page.

So my config.toml will look this:

### Site settings
baseurl = "your_firebase_address"
languageCode = "en"
title = "SM Blog"
theme = "hugo-theme-cactus-plus"
googleAnalytics = "your_google_analytics_id"

[params]
    # My information
    author = "Cat Lense"
    description = "blog about cats"
    bio = "cat photographer"
    twitter = "cats"
    copyright = "Cat Photographer"

    # Tools 
    enableRSS = true
    enableDisqus = true
    disqusShortname = "your_disqus_short_name"
    enableSummary = true
    enableGoogleAnalytics = true
    enableTwitterCard = true

[social]
    twitter = "https://twitter.com/cats"
    github = "https://github.com/cats"

Creating Your First Post

Hugo posts are written in markdown. So you’ll need to be familiar with it. When creating a post, you’re actually creating a markdown file that Hugo will then render into HTML. Take the title of your post, make it lower case, substitute the spaces with hyphens. That will be the name of your post. Hugo takes the file name, replaces the hyphens with spaces, transforms it to start case, then sets it as the title. I’ll name my file my-first-post.md. To create your first post, run:

hugo new posts/my-first-post.md

The post is created in the /content folder. These are the contents of the file.

---
title: "My First Post"
date: 2020-03-18T15:59:53+03:00
draft: true
---

A post contains front matter which is the metadata that describes your post. If you’d like to keep your posts as drafts while you write them, leave draft: true. Once you’re done writing, change draft: false so that the posts can be displayed on the home page. I’ll add a summary line to the front matter to summarize the post on the home page.

Adding Resources To Your Post

To add resources to your posts like images, videos, audio files, etc. create a folder within the /content/posts folder with the same name as your post excluding the extension.

For example, I’d create this folder:

mkdir content/posts/my-first-post

Then I’d add all my post resources to that folder and link to the resources just by file name without having to specify a long URL. For example, I’d add an image like this:

![A cute cat](cute-cat.png)

Hosting Your Blog’s Source Code

Once you’re done writing your first post, it’s important to back it up before you deploy it. Before that, make sure you have a .gitignore file and add the /public folder to it. The public folder should be ignored because it can be generated again.

Create a repository on Github to host your blog’s source code. Then set the remote repository locally.

git remote add origin [remote repository URL]

Finally, stage and commit all your changes then push them to the remote repository.

git add *
git commit -m "Add my first post"
git push origin master

Deploying Your Blog To Firebase

Before you can deploy your blog to Firebase, you’ll need to create a project on Firebase. Head on over to the Firebase Console. Click on Add Project.

Firebase Console home page where the “Create a Project” button resides. (Large preview)

Input the name of your project.

First page of “Create a project” flow on Firebase Console. (Large preview)

Enable Google Analytics if you want to use it in your blog.

Second page of “Create a project” flow on Firebase Console. (Large preview)

Third page of “Create a project” flow on Firebase Console. (Large preview)

Once you’re done creating the project, go back to your blog’s root and initialize a Firebase project in the blog.

firebase init

You’ll be prompted to enter some information when this command runs.

Prompts Answer
Which Firebase CLI features do you want to set up for this folder? Hosting: Configure and deploy Firebase Hosting sites
Project Setup Options Use an existing project
What do you want to use as your public directory? public
Configure as a single-page app (rewrite all urls to /index.html)? N

First prompt of the firebase init command requesting a feature selection. (Large preview)

Second prompt of the firebase init command requesting a project selection. (Large preview)

Third and fourth prompts of the firebase init command requesting a deployment folder and inquiring whether to configure the project as a single-page app. (Large preview)

Next, we’ll build the blog. A /public folder will be created and it will contain your generated blog.

hugo

After this, all we have to do is deploy the blog.

firebase deploy

Now the blog is deployed. Check it out at the hosting URL provided in the output.

Output from running the firebase deploy command. (Large preview)

Next Steps

The only drawback of hosting on Firebase is the URL it uses for your hosted project. It can be unsightly and difficult to remember. So I’d advise that you buy a domain and set it up for your blog.

Third-party platforms are not all bad. They have tons of readers who may be interested in your writing but haven’t come across your blog yet. You could cross-post to those sites to put your work in front of a large audience but don’t forget to link back to your own blog. Add the link to your article on your blog to whichever platform you are posting to as a canonical URL so that it is not viewed as duplicate content by a search engine and hurts the SEO of your site. Sites like Medium, dev.to, and Hashnode support canonical URLs.

Conclusion

Writing on your own technical blog can have immense benefits to your career as a software developer and help you cultivate your skills and expertise. It’s my hope that this tutorial has started you on that journey or at least encouraged you to make your own blog.

(ra, il)
Categories: Others Tags: